[gimp] widgets: use gtk_widget_get_parent(menu) instead of menu->toplevel



commit 7d54c72cfe99b9ee1c9887f9ec277b5c2b66808c
Author: Michael Natterer <mitch gimp org>
Date:   Thu Feb 11 10:34:48 2010 +0100

    widgets: use gtk_widget_get_parent(menu) instead of menu->toplevel
    
    because menu->toplevel is sealed. Should have the additional benefit
    of also working if the menu is torn off (untested).

 app/widgets/gimpuimanager.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/app/widgets/gimpuimanager.c b/app/widgets/gimpuimanager.c
index ecfda9e..65737a7 100644
--- a/app/widgets/gimpuimanager.c
+++ b/app/widgets/gimpuimanager.c
@@ -20,10 +20,10 @@
 
 #include "config.h"
 
-#undef GSEAL_ENABLE
-
 #include <string.h>
 
+#undef GSEAL_ENABLE
+
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -953,7 +953,8 @@ gimp_ui_manager_item_key_press (GtkWidget     *widget,
 
       if (! menu_item && GTK_IS_MENU (widget))
         {
-          GdkWindow *window = gtk_widget_get_window (GTK_MENU (widget)->toplevel);
+          GtkWidget *parent = gtk_widget_get_parent (widget);
+          GdkWindow *window = gtk_widget_get_window (parent);
           gint       x, y;
 
           gdk_window_get_pointer (window, &x, &y, NULL);



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