[gimp] (gui_display_get_window): return the ID of the toplevel, not of the shell



commit 98a465318640ca27aa1d41dc191c9d6b29424ea3
Author: Michael Natterer <mitch gimp org>
Date:   Wed Sep 30 17:01:55 2009 +0200

    (gui_display_get_window): return the ID of the toplevel, not of the shell

 app/gui/gui-vtable.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c
index c73bf46..8917e6d 100644
--- a/app/gui/gui-vtable.c
+++ b/app/gui/gui-vtable.c
@@ -316,7 +316,12 @@ gui_display_get_window (GimpObject *display)
   GimpDisplay *disp = GIMP_DISPLAY (display);
 
   if (disp->shell)
-    return (guint32) gimp_window_get_native (GTK_WINDOW (disp->shell));
+    {
+      GtkWidget *toplevel = gtk_widget_get_toplevel (disp->shell);
+
+      if (GTK_IS_WINDOW (toplevel))
+        return (guint32) gimp_window_get_native (GTK_WINDOW (toplevel));
+    }
 
   return 0;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]