Merge lp:~attente/gtk/1208019 into lp:~ubuntu-desktop/gtk/ubuntugtk3trusty

Proposed by William Hua on 2014-07-28
Status: Merged
Merged at revision: 339
Proposed branch: lp:~attente/gtk/1208019
Merge into: lp:~ubuntu-desktop/gtk/ubuntugtk3trusty
Diff against target: 130 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/1208019
Reviewer Review Type Date Requested Status
Ubuntu Desktop 2014-07-28 Pending
Review via email: mp+228506@code.launchpad.net

Description of the change

 * Take upstream git-menu-binding-emit-submenu-close-after-activate.patch:
   - Ensures that menu item activations occur before GMenuModel
     submenu-action state changes (LP: #1208019)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-07-28 14:56:10 +0000
3+++ debian/changelog 2014-07-28 15:04:07 +0000
4@@ -1,8 +1,14 @@
5 gtk+3.0 (3.10.8-0ubuntu1.2) UNRELEASED; urgency=medium
6
7+ [ Iain Lane ]
8 * Update Vcs-Bzr to a trusty branch.
9
10- -- Iain Lane <iain@orangesquash.org.uk> Mon, 28 Jul 2014 15:56:01 +0100
11+ [ William Hua ]
12+ * Take upstream git-menu-binding-emit-submenu-close-after-activate.patch:
13+ - Ensures that menu item activations occur before GMenuModel
14+ submenu-action state changes (LP: #1208019)
15+
16+ -- William Hua <william.hua@canonical.com> Mon, 28 Jul 2014 15:56:01 +0100
17
18 gtk+3.0 (3.10.8-0ubuntu1.1) trusty; urgency=medium
19
20
21=== added file 'debian/patches/git-menu-binding-emit-submenu-close-after-activate.patch'
22--- debian/patches/git-menu-binding-emit-submenu-close-after-activate.patch 1970-01-01 00:00:00 +0000
23+++ debian/patches/git-menu-binding-emit-submenu-close-after-activate.patch 2014-07-28 15:04:07 +0000
24@@ -0,0 +1,97 @@
25+From b532e1ff0ab25303c838565220e8d41fb3044a05 Mon Sep 17 00:00:00 2001
26+From: Ryan Lortie <desrt@desrt.ca>
27+Date: Mon, 16 Jun 2014 14:26:21 -0400
28+Subject: [PATCH] menu binding: emit submenu close after activate
29+
30+We want to make sure that the submenu action is changed back to FALSE
31+_after_ the menu item has been activated. This prevents the menu
32+teardown handler from deleting the menu item before it can be activated.
33+
34+Unfortunately, GtkMenuShell emits "hide" before the item activation.
35+This is probably done to prevent the application from doing things like
36+showing dialogs when the menu is still holding the grab.
37+
38+In the case where we are doing an activate, set a boolean flag on each
39+of the open menus (following the parent stack) indicating that we'll be
40+emitting another signal soon (selection done). If that flag is set, we
41+defer the setting of the submenu action until we receive the second
42+signal.
43+
44+https://bugzilla.gnome.org/show_bug.cgi?id=729820
45+---
46+ gtk/gtkmenushell.c | 21 +++++++++++++++++++--
47+ gtk/gtkmenushellprivate.h | 5 +++++
48+ 2 files changed, 24 insertions(+), 2 deletions(-)
49+
50+diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
51+index 18f1542..d1d0c7f 100644
52+--- a/gtk/gtkmenushell.c
53++++ b/gtk/gtkmenushell.c
54+@@ -1360,6 +1360,8 @@ gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
55+
56+ do
57+ {
58++ parent_menu_shell->priv->selection_done_coming_soon = TRUE;
59++
60+ g_object_ref (parent_menu_shell);
61+ shells = g_slist_prepend (shells, parent_menu_shell);
62+ parent_menu_shell = (GtkMenuShell*) parent_menu_shell->priv->parent_menu_shell;
63+@@ -1379,7 +1381,10 @@ gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
64+
65+ for (slist = shells; slist; slist = slist->next)
66+ {
67+- g_signal_emit (slist->data, menu_shell_signals[SELECTION_DONE], 0);
68++ GtkMenuShell *parent_menu_shell = slist->data;
69++
70++ g_signal_emit (parent_menu_shell, menu_shell_signals[SELECTION_DONE], 0);
71++ parent_menu_shell->priv->selection_done_coming_soon = FALSE;
72+ g_object_unref (slist->data);
73+ }
74+ g_slist_free (shells);
75+@@ -2010,7 +2015,18 @@ gtk_menu_shell_submenu_hidden (GtkWidget *submenu,
76+ {
77+ GtkMenuTrackerItem *item = user_data;
78+
79+- gtk_menu_tracker_item_request_submenu_shown (item, FALSE);
80++ if (!GTK_MENU_SHELL (submenu)->priv->selection_done_coming_soon)
81++ gtk_menu_tracker_item_request_submenu_shown (item, FALSE);
82++}
83++
84++static void
85++gtk_menu_shell_submenu_selection_done (GtkWidget *submenu,
86++ gpointer user_data)
87++{
88++ GtkMenuTrackerItem *item = user_data;
89++
90++ if (GTK_MENU_SHELL (submenu)->priv->selection_done_coming_soon)
91++ gtk_menu_tracker_item_request_submenu_shown (item, FALSE);
92+ }
93+
94+ static void
95+@@ -2091,6 +2107,7 @@ gtk_menu_shell_tracker_insert_func (GtkMenuTrackerItem *item,
96+ */
97+ g_signal_connect (submenu, "show", G_CALLBACK (gtk_menu_shell_submenu_shown), item);
98+ g_signal_connect (submenu, "hide", G_CALLBACK (gtk_menu_shell_submenu_hidden), item);
99++ g_signal_connect (submenu, "selection-done", G_CALLBACK (gtk_menu_shell_submenu_selection_done), item);
100+ }
101+
102+ gtk_widget_show (widget);
103+diff --git a/gtk/gtkmenushellprivate.h b/gtk/gtkmenushellprivate.h
104+index 622f0fd..233be34 100644
105+--- a/gtk/gtkmenushellprivate.h
106++++ b/gtk/gtkmenushellprivate.h
107+@@ -61,6 +61,11 @@ struct _GtkMenuShellPrivate
108+ * the user moves the mouse over
109+ * an unselectable menuitem.
110+ */
111++
112++ guint selection_done_coming_soon : 1; /* Set TRUE when a selection-done
113++ * signal is coming soon (when checked
114++ * from inside of a "hide" handler).
115++ */
116+ GtkMnemonicHash *mnemonic_hash;
117+ GtkKeyHash *key_hash;
118+
119+--
120+2.0.0
121+
122
123=== modified file 'debian/patches/series'
124--- debian/patches/series 2014-07-28 14:53:12 +0000
125+++ debian/patches/series 2014-07-28 15:04:07 +0000
126@@ -1,3 +1,4 @@
127+git-menu-binding-emit-submenu-close-after-activate.patch
128 016_no_offscreen_widgets_grabbing.patch
129 017_no_offscreen_device_grabbing.patch
130 018_gdkenumtypes.c_location.patch

Subscribers

People subscribed via source and target branches

to all changes: