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).
This commit is contained in:
Michael Natterer
2010-02-11 10:34:48 +01:00
parent 8a3d32a061
commit 7d54c72cfe

View File

@ -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);