[gimp] Bug 595708 - WM_WINDOW_ROLE should be unique
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 595708 - WM_WINDOW_ROLE should be unique
- Date: Sun, 7 Oct 2012 16:17:31 +0000 (UTC)
commit d4c72cd5abaece9a69b46e035422d5cde70e56d4
Author: Michael Natterer <mitch gimp org>
Date: Sun Oct 7 18:16:35 2012 +0200
Bug 595708 - WM_WINDOW_ROLE should be unique
Make the roles of toolbox, dock and image window unique by adding a
serial number, resulting in e.g. gimp-dock-1.
app/dialogs/dialogs-constructors.c | 20 ++++++++++++++++++--
app/display/gimpimagewindow.c | 8 +++++++-
2 files changed, 25 insertions(+), 3 deletions(-)
---
diff --git a/app/dialogs/dialogs-constructors.c b/app/dialogs/dialogs-constructors.c
index ff16c5f..4db485f 100644
--- a/app/dialogs/dialogs-constructors.c
+++ b/app/dialogs/dialogs-constructors.c
@@ -243,11 +243,19 @@ dialogs_toolbox_dock_window_new (GimpDialogFactory *factory,
GimpUIManager *ui_manager,
gint view_size)
{
- return gimp_dock_window_new ("gimp-toolbox",
+ static gint role_serial = 1;
+ GtkWidget *dock;
+ gchar *role;
+
+ role = g_strdup_printf ("gimp-toolbox-%d", role_serial++);
+ dock = gimp_dock_window_new (role,
"<Toolbox>",
TRUE,
factory,
context);
+ g_free (role);
+
+ return dock;
}
GtkWidget *
@@ -265,11 +273,19 @@ dialogs_dock_window_new (GimpDialogFactory *factory,
GimpUIManager *ui_manager,
gint view_size)
{
- return gimp_dock_window_new ("gimp-dock",
+ static gint role_serial = 1;
+ GtkWidget *dock;
+ gchar *role;
+
+ role = g_strdup_printf ("gimp-dock-%d", role_serial++);
+ dock = gimp_dock_window_new (role,
"<Dock>",
FALSE,
factory,
context);
+ g_free (role);
+
+ return dock;
}
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index 024b9ae..f1dbcdb 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -282,7 +282,13 @@ gimp_image_window_class_init (GimpImageWindowClass *klass)
static void
gimp_image_window_init (GimpImageWindow *window)
{
- gtk_window_set_role (GTK_WINDOW (window), "gimp-image-window");
+ static gint role_serial = 1;
+ gchar *role;
+
+ role = g_strdup_printf ("gimp-image-window-%d", role_serial++);
+ gtk_window_set_role (GTK_WINDOW (window), role);
+ g_free (role);
+
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]