summaryrefslogtreecommitdiff
path: root/gtk/gtkmenushell.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-11-25 14:04:52 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-11-25 14:08:55 +0900
commit6716e7c3f1925560a5b4901581cabbaee4e01e28 (patch)
treec7c54759ce3b4c0e54ef5061174ebb24b6981824 /gtk/gtkmenushell.c
parent2e3935ba9db3a7864b3eefed5da800b26aef97ef (diff)
downloadgtk+-6716e7c3f1925560a5b4901581cabbaee4e01e28.tar.gz
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.
Diffstat (limited to 'gtk/gtkmenushell.c')
-rw-r--r--gtk/gtkmenushell.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index d630cdd253..7b94ce9b25 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -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)