Merge lp:~aacid/gtk/ubuntugtk3_nmenomic_patch into lp:~ubuntu-desktop/gtk/ubuntugtk3

Proposed by Albert Astals Cid
Status: Merged
Merged at revision: 229
Proposed branch: lp:~aacid/gtk/ubuntugtk3_nmenomic_patch
Merge into: lp:~ubuntu-desktop/gtk/ubuntugtk3
Diff against target: 51 lines (+15/-7)
1 file modified
debian/patches/043_ubuntu_menu_proxy.patch (+15/-7)
To merge this branch: bzr merge lp:~aacid/gtk/ubuntugtk3_nmenomic_patch
Reviewer Review Type Date Requested Status
Ubuntu Desktop Pending
Review via email: mp+125169@code.launchpad.net

Description of the change

Do not hijack mnemonics for menus that don't have a menubar as parent (e.g. a RMB context menu in nautilus)

Based on ted suggestion that the appmenubar-gtk proxy thingie should be only for menus that belong to a window menubar

To post a comment you must log in.
230. By Albert Astals Cid

do not change diff headers much

231. By Albert Astals Cid

Now really, don't change the headers much

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/patches/043_ubuntu_menu_proxy.patch'
2--- debian/patches/043_ubuntu_menu_proxy.patch 2012-09-19 01:20:28 +0000
3+++ debian/patches/043_ubuntu_menu_proxy.patch 2012-09-19 11:31:21 +0000
4@@ -1060,32 +1060,40 @@
5 +#endif /* __UBUNTU_MENU_PROXY_MODULE_H__ */
6 Index: gtk+-3.5.18/gtk/gtkmnemonichash.c
7 ===================================================================
8---- gtk+-3.5.18.orig/gtk/gtkmnemonichash.c 2012-09-19 03:34:42.000000000 +1200
9-+++ gtk+-3.5.18/gtk/gtkmnemonichash.c 2012-09-19 12:17:02.564727946 +1200
10-@@ -18,6 +18,9 @@
11+--- gtk+-3.5.18.orig/gtk/gtkmnemonichash.c 2012-09-19 10:41:33.439291224 +0200
12++++ gtk+-3.5.18/gtk/gtkmnemonichash.c 2012-09-19 12:41:33.439291224 +0200
13+@@ -18,6 +18,10 @@
14 */
15
16 #include "gtkmnemonichash.h"
17 +#include "ubuntumenuproxy.h"
18 +#include "gtkmenuitem.h"
19++#include "gtkmenubar.h"
20 +#include "gtkaccellabel.h"
21
22 struct _GtkMnemnonicHash
23 {
24-@@ -113,6 +116,7 @@
25+@@ -112,7 +116,8 @@
26+ GSList *list, *targets;
27 GtkWidget *widget, *chosen_widget;
28 GdkWindow *window;
29- gboolean overloaded;
30+- gboolean overloaded;
31++ gboolean overloaded, hasMenuBarParent;
32 + UbuntuMenuProxy * menu_proxy = ubuntu_menu_proxy_get();
33
34 targets = g_hash_table_lookup (mnemonic_hash->hash,
35 GUINT_TO_POINTER (keyval));
36-@@ -126,9 +130,11 @@
37+@@ -125,10 +130,16 @@
38+ {
39 widget = GTK_WIDGET (list->data);
40 window = gtk_widget_get_window (widget);
41++ if (widget)
42++ hasMenuBarParent = gtk_widget_get_ancestor(widget, GTK_TYPE_MENU_BAR) != NULL;
43++ else
44++ hasMenuBarParent = FALSE;
45
46 - if (gtk_widget_is_sensitive (widget) &&
47-+ if ((menu_proxy && !ubuntu_menu_proxy_show_local(menu_proxy) && GTK_IS_ACCEL_LABEL(widget))
48++ if ((menu_proxy && hasMenuBarParent && !ubuntu_menu_proxy_show_local(menu_proxy) && GTK_IS_ACCEL_LABEL(widget))
49 + || (gtk_widget_is_sensitive (widget) &&
50 gtk_widget_get_mapped (widget) &&
51 window && gdk_window_is_viewable (window))

Subscribers

People subscribed via source and target branches