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
=== modified file 'debian/patches/043_ubuntu_menu_proxy.patch'
--- debian/patches/043_ubuntu_menu_proxy.patch 2012-09-19 01:20:28 +0000
+++ debian/patches/043_ubuntu_menu_proxy.patch 2012-09-19 11:31:21 +0000
@@ -1060,32 +1060,40 @@
1060+#endif /* __UBUNTU_MENU_PROXY_MODULE_H__ */1060+#endif /* __UBUNTU_MENU_PROXY_MODULE_H__ */
1061Index: gtk+-3.5.18/gtk/gtkmnemonichash.c1061Index: gtk+-3.5.18/gtk/gtkmnemonichash.c
1062===================================================================1062===================================================================
1063--- gtk+-3.5.18.orig/gtk/gtkmnemonichash.c 2012-09-19 03:34:42.000000000 +12001063--- gtk+-3.5.18.orig/gtk/gtkmnemonichash.c 2012-09-19 10:41:33.439291224 +0200
1064+++ gtk+-3.5.18/gtk/gtkmnemonichash.c 2012-09-19 12:17:02.564727946 +12001064+++ gtk+-3.5.18/gtk/gtkmnemonichash.c 2012-09-19 12:41:33.439291224 +0200
1065@@ -18,6 +18,9 @@1065@@ -18,6 +18,10 @@
1066 */1066 */
1067 1067
1068 #include "gtkmnemonichash.h"1068 #include "gtkmnemonichash.h"
1069+#include "ubuntumenuproxy.h"1069+#include "ubuntumenuproxy.h"
1070+#include "gtkmenuitem.h"1070+#include "gtkmenuitem.h"
1071+#include "gtkmenubar.h"
1071+#include "gtkaccellabel.h"1072+#include "gtkaccellabel.h"
1072 1073
1073 struct _GtkMnemnonicHash1074 struct _GtkMnemnonicHash
1074 {1075 {
1075@@ -113,6 +116,7 @@1076@@ -112,7 +116,8 @@
1077 GSList *list, *targets;
1076 GtkWidget *widget, *chosen_widget;1078 GtkWidget *widget, *chosen_widget;
1077 GdkWindow *window;1079 GdkWindow *window;
1078 gboolean overloaded;1080- gboolean overloaded;
1081+ gboolean overloaded, hasMenuBarParent;
1079+ UbuntuMenuProxy * menu_proxy = ubuntu_menu_proxy_get();1082+ UbuntuMenuProxy * menu_proxy = ubuntu_menu_proxy_get();
1080 1083
1081 targets = g_hash_table_lookup (mnemonic_hash->hash,1084 targets = g_hash_table_lookup (mnemonic_hash->hash,
1082 GUINT_TO_POINTER (keyval));1085 GUINT_TO_POINTER (keyval));
1083@@ -126,9 +130,11 @@1086@@ -125,10 +130,16 @@
1087 {
1084 widget = GTK_WIDGET (list->data);1088 widget = GTK_WIDGET (list->data);
1085 window = gtk_widget_get_window (widget);1089 window = gtk_widget_get_window (widget);
1090+ if (widget)
1091+ hasMenuBarParent = gtk_widget_get_ancestor(widget, GTK_TYPE_MENU_BAR) != NULL;
1092+ else
1093+ hasMenuBarParent = FALSE;
1086 1094
1087- if (gtk_widget_is_sensitive (widget) &&1095- if (gtk_widget_is_sensitive (widget) &&
1088+ if ((menu_proxy && !ubuntu_menu_proxy_show_local(menu_proxy) && GTK_IS_ACCEL_LABEL(widget))1096+ if ((menu_proxy && hasMenuBarParent && !ubuntu_menu_proxy_show_local(menu_proxy) && GTK_IS_ACCEL_LABEL(widget))
1089+ || (gtk_widget_is_sensitive (widget) &&1097+ || (gtk_widget_is_sensitive (widget) &&
1090 gtk_widget_get_mapped (widget) &&1098 gtk_widget_get_mapped (widget) &&
1091 window && gdk_window_is_viewable (window))1099 window && gdk_window_is_viewable (window))

Subscribers

People subscribed via source and target branches