Merge lp:~attente/gtk/menu-binding-emit-submenu-close-after-activate into lp:~ubuntu-desktop/gtk/ubuntugtk3

Proposed by William Hua
Status: Merged
Merged at revision: 352
Proposed branch: lp:~attente/gtk/menu-binding-emit-submenu-close-after-activate
Merge into: lp:~ubuntu-desktop/gtk/ubuntugtk3
Diff against target: 133 lines (+105/-1)
3 files modified
debian/changelog (+7/-1)
debian/patches/git-menu-binding-emit-submenu-close-after-activate.patch (+97/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~attente/gtk/menu-binding-emit-submenu-close-after-activate
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Review via email: mp+223420@code.launchpad.net

Commit message

Take upstream's menu-binding-emit-submenu-close-after-activate commit, which ensures that menu item activations occur before GMenuModel submenu-action state changes.

Description of the change

Take upstream's menu-binding-emit-submenu-close-after-activate commit, which ensures that menu item activations occur before GMenuModel submenu-action state changes.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

That should work, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2014-06-13 09:34:40 +0000
+++ debian/changelog 2014-06-17 15:15:20 +0000
@@ -1,11 +1,17 @@
1gtk+3.0 (3.12.2-0ubuntu3) UNRELEASED; urgency=medium1gtk+3.0 (3.12.2-0ubuntu3) UNRELEASED; urgency=medium
22
3 [ Lars Uebernickel ]
3 * Remove a11y-tests-disable-color-chooser-and-message-dialog-.patch:4 * Remove a11y-tests-disable-color-chooser-and-message-dialog-.patch:
4 update title bar and message dialog patches with the proper fixes instead5 update title bar and message dialog patches with the proper fixes instead
5 * Remove revert-fix-up-builder.patch: Dialogs have one child again:6 * Remove revert-fix-up-builder.patch: Dialogs have one child again:
6 included in the title bar patch now7 included in the title bar patch now
78
8 -- Lars Uebernickel <lars.uebernickel@ubuntu.com> Thu, 12 Jun 2014 11:06:44 +02009 [ William Hua ]
10 * Take upstream git-menu-binding-emit-submenu-close-after-activate.patch:
11 - Ensures that menu item activations occur before GMenuModel
12 submenu-action state changes (LP: #1208019)
13
14 -- William Hua <william.hua@canonical.com> Tue, 17 Jun 2014 10:15:41 -0400
915
10gtk+3.0 (3.12.2-0ubuntu2) utopic; urgency=medium16gtk+3.0 (3.12.2-0ubuntu2) utopic; urgency=medium
1117
1218
=== added file 'debian/patches/git-menu-binding-emit-submenu-close-after-activate.patch'
--- debian/patches/git-menu-binding-emit-submenu-close-after-activate.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/git-menu-binding-emit-submenu-close-after-activate.patch 2014-06-17 15:15:20 +0000
@@ -0,0 +1,97 @@
1From b532e1ff0ab25303c838565220e8d41fb3044a05 Mon Sep 17 00:00:00 2001
2From: Ryan Lortie <desrt@desrt.ca>
3Date: Mon, 16 Jun 2014 14:26:21 -0400
4Subject: [PATCH] menu binding: emit submenu close after activate
5
6We want to make sure that the submenu action is changed back to FALSE
7_after_ the menu item has been activated. This prevents the menu
8teardown handler from deleting the menu item before it can be activated.
9
10Unfortunately, GtkMenuShell emits "hide" before the item activation.
11This is probably done to prevent the application from doing things like
12showing dialogs when the menu is still holding the grab.
13
14In the case where we are doing an activate, set a boolean flag on each
15of the open menus (following the parent stack) indicating that we'll be
16emitting another signal soon (selection done). If that flag is set, we
17defer the setting of the submenu action until we receive the second
18signal.
19
20https://bugzilla.gnome.org/show_bug.cgi?id=729820
21---
22 gtk/gtkmenushell.c | 21 +++++++++++++++++++--
23 gtk/gtkmenushellprivate.h | 5 +++++
24 2 files changed, 24 insertions(+), 2 deletions(-)
25
26diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
27index 18f1542..d1d0c7f 100644
28--- a/gtk/gtkmenushell.c
29+++ b/gtk/gtkmenushell.c
30@@ -1360,6 +1360,8 @@ gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
31
32 do
33 {
34+ parent_menu_shell->priv->selection_done_coming_soon = TRUE;
35+
36 g_object_ref (parent_menu_shell);
37 shells = g_slist_prepend (shells, parent_menu_shell);
38 parent_menu_shell = (GtkMenuShell*) parent_menu_shell->priv->parent_menu_shell;
39@@ -1379,7 +1381,10 @@ gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
40
41 for (slist = shells; slist; slist = slist->next)
42 {
43- g_signal_emit (slist->data, menu_shell_signals[SELECTION_DONE], 0);
44+ GtkMenuShell *parent_menu_shell = slist->data;
45+
46+ g_signal_emit (parent_menu_shell, menu_shell_signals[SELECTION_DONE], 0);
47+ parent_menu_shell->priv->selection_done_coming_soon = FALSE;
48 g_object_unref (slist->data);
49 }
50 g_slist_free (shells);
51@@ -2010,7 +2015,18 @@ gtk_menu_shell_submenu_hidden (GtkWidget *submenu,
52 {
53 GtkMenuTrackerItem *item = user_data;
54
55- gtk_menu_tracker_item_request_submenu_shown (item, FALSE);
56+ if (!GTK_MENU_SHELL (submenu)->priv->selection_done_coming_soon)
57+ gtk_menu_tracker_item_request_submenu_shown (item, FALSE);
58+}
59+
60+static void
61+gtk_menu_shell_submenu_selection_done (GtkWidget *submenu,
62+ gpointer user_data)
63+{
64+ GtkMenuTrackerItem *item = user_data;
65+
66+ if (GTK_MENU_SHELL (submenu)->priv->selection_done_coming_soon)
67+ gtk_menu_tracker_item_request_submenu_shown (item, FALSE);
68 }
69
70 static void
71@@ -2091,6 +2107,7 @@ gtk_menu_shell_tracker_insert_func (GtkMenuTrackerItem *item,
72 */
73 g_signal_connect (submenu, "show", G_CALLBACK (gtk_menu_shell_submenu_shown), item);
74 g_signal_connect (submenu, "hide", G_CALLBACK (gtk_menu_shell_submenu_hidden), item);
75+ g_signal_connect (submenu, "selection-done", G_CALLBACK (gtk_menu_shell_submenu_selection_done), item);
76 }
77
78 gtk_widget_show (widget);
79diff --git a/gtk/gtkmenushellprivate.h b/gtk/gtkmenushellprivate.h
80index 622f0fd..233be34 100644
81--- a/gtk/gtkmenushellprivate.h
82+++ b/gtk/gtkmenushellprivate.h
83@@ -61,6 +61,11 @@ struct _GtkMenuShellPrivate
84 * the user moves the mouse over
85 * an unselectable menuitem.
86 */
87+
88+ guint selection_done_coming_soon : 1; /* Set TRUE when a selection-done
89+ * signal is coming soon (when checked
90+ * from inside of a "hide" handler).
91+ */
92 GtkMnemonicHash *mnemonic_hash;
93 GtkKeyHash *key_hash;
94
95--
962.0.0
97
098
=== modified file 'debian/patches/series'
--- debian/patches/series 2014-06-13 09:04:58 +0000
+++ debian/patches/series 2014-06-17 15:15:20 +0000
@@ -1,3 +1,4 @@
1git-menu-binding-emit-submenu-close-after-activate.patch
1016_no_offscreen_widgets_grabbing.patch2016_no_offscreen_widgets_grabbing.patch
2017_no_offscreen_device_grabbing.patch3017_no_offscreen_device_grabbing.patch
3018_gdkenumtypes.c_location.patch4018_gdkenumtypes.c_location.patch

Subscribers

People subscribed via source and target branches

to all changes: