Commit 35b4627c authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

request notification about changes to the "transient-docks" preference and

2005-05-12  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpimagedock.c: request notification about changes
	to the "transient-docks" preference and drop the transient
	relationship if it is disabled.

plus some other changes / fixes to my previous commit
parent 840e5f46
2005-05-12 Sven Neumann <sven@gimp.org>
* app/widgets/gimpimagedock.c: request notification about changes
to the "transient-docks" preference and react accordingly.
2005-05-12 Sven Neumann <sven@gimp.org>
* app/config/gimpguiconfig.[ch]
......
......@@ -270,11 +270,11 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
DOCK_WINDOW_HINT_BLURB,
GIMP_TYPE_WINDOW_HINT,
GIMP_WINDOW_HINT_NORMAL,
0);
GIMP_CONFIG_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TRANSIENT_DOCKS,
"transient-docks", TRANSIENT_DOCKS_BLURB,
FALSE,
GIMP_CONFIG_PARAM_RESTART);
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_CURSOR_FORMAT,
"cursor-format", CURSOR_FORMAT_BLURB,
GIMP_TYPE_CURSOR_FORMAT,
......
......@@ -350,9 +350,10 @@ N_("Sets the swap file location. The gimp uses a tile based memory " \
N_("When enabled, menus can be torn off.")
#define TRANSIENT_DOCKS_BLURB \
N_("When enabled, dock windows (the toolbox and palettes) are transient " \
"transient to the active image window. With most window managers this " \
"keeps the dock windows above the image window.")
N_("When enabled, dock windows (the toolbox and palettes) are set to be " \
"transient to the active image window. Most window managers will " \
"keep the dock windows above the image window then, but it may also " \
"have other effects.")
#define CAN_CHANGE_ACCELS_BLURB \
N_("When enabled, you can change keyboard shortcuts for menu items " \
......
......@@ -37,20 +37,24 @@
#include "gimpuimanager.h"
static void gimp_image_dock_class_init (GimpImageDockClass *klass);
static void gimp_image_dock_init (GimpImageDock *dock);
static void gimp_image_dock_class_init (GimpImageDockClass *klass);
static void gimp_image_dock_init (GimpImageDock *dock);
static GObject * gimp_image_dock_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static GObject * gimp_image_dock_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_image_dock_destroy (GtkObject *object);
static void gimp_image_dock_destroy (GtkObject *object);
static void gimp_image_dock_display_changed (GimpContext *context,
GimpObject *display,
GimpImageDock *dock);
static void gimp_image_dock_image_flush (GimpImage *image,
GimpImageDock *dock);
static void gimp_image_dock_display_changed (GimpContext *context,
GimpObject *display,
GimpImageDock *dock);
static void gimp_image_dock_image_flush (GimpImage *image,
GimpImageDock *dock);
static void gimp_image_dock_notify_transient (GimpConfig *config,
GParamSpec *pspec,
GimpDock *dock);
static GimpDockClass *parent_class = NULL;
......@@ -142,6 +146,11 @@ gimp_image_dock_constructor (GType type,
G_CALLBACK (gimp_image_dock_display_changed),
dock, 0);
g_signal_connect_object (GIMP_DOCK (dock)->context->gimp->config,
"notify::transient-docks",
G_CALLBACK (gimp_image_dock_notify_transient),
dock, 0);
return object;
}
......@@ -199,3 +208,20 @@ gimp_image_dock_image_flush (GimpImage *image,
gimp_ui_manager_update (dock->ui_manager, display);
}
}
static void
gimp_image_dock_notify_transient (GimpConfig *config,
GParamSpec *pspec,
GimpDock *dock)
{
if (GIMP_GUI_CONFIG (config)->transient_docks)
{
gimp_image_dock_display_changed (dock->context,
gimp_context_get_display (dock->context),
GIMP_IMAGE_DOCK (dock));
}
else
{
gtk_window_set_transient_for (GTK_WINDOW (dock), NULL);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment