Commit 6716e7c3 authored by Tristan Van Berkom's avatar Tristan Van Berkom

Fixed GtkMenuShell to deactivate itself at dispose time

Since GdkDevice stuff, it seems that destroying an active
menu doesnt get rid of all the device grabery, this fixes
bug 635693.
parent 2e3935ba
......@@ -1760,8 +1760,11 @@ gtk_menu_popdown (GtkMenu *menu)
/* The X Grab, if present, will automatically be removed when we hide
* the window */
gtk_widget_hide (menu->toplevel);
gtk_window_set_transient_for (GTK_WINDOW (menu->toplevel), NULL);
if (menu->toplevel)
{
gtk_widget_hide (menu->toplevel);
gtk_window_set_transient_for (GTK_WINDOW (menu->toplevel), NULL);
}
pointer = _gtk_menu_shell_get_grab_device (menu_shell);
......
......@@ -153,6 +153,7 @@ static void gtk_menu_shell_get_property (GObject *object,
GParamSpec *pspec);
static void gtk_menu_shell_realize (GtkWidget *widget);
static void gtk_menu_shell_finalize (GObject *object);
static void gtk_menu_shell_dispose (GObject *object);
static gint gtk_menu_shell_button_press (GtkWidget *widget,
GdkEventButton *event);
static gint gtk_menu_shell_button_release (GtkWidget *widget,
......@@ -222,6 +223,7 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
object_class->set_property = gtk_menu_shell_set_property;
object_class->get_property = gtk_menu_shell_get_property;
object_class->finalize = gtk_menu_shell_finalize;
object_class->dispose = gtk_menu_shell_dispose;
widget_class->realize = gtk_menu_shell_realize;
widget_class->button_press_event = gtk_menu_shell_button_press;
......@@ -463,6 +465,16 @@ gtk_menu_shell_finalize (GObject *object)
}
static void
gtk_menu_shell_dispose (GObject *object)
{
GtkMenuShell *menu_shell = GTK_MENU_SHELL (object);
gtk_menu_shell_deactivate (menu_shell);
G_OBJECT_CLASS (gtk_menu_shell_parent_class)->dispose (object);
}
void
gtk_menu_shell_append (GtkMenuShell *menu_shell,
GtkWidget *child)
......
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