summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-07-18 14:42:13 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-07-18 14:42:13 -0400
commit9f3a9ef02de17704b5d9cd9b5d3d674788d23a8d (patch)
treee57bc3a99fe5e8164cf91fdf4771878bc1a1b684
parent1a55e83e98adf46b15cca2062ba2ad571a68c780 (diff)
before pushing keybindings to GTK for menu display, make sure that we add back the META modifer that GTK expects
-rw-r--r--libs/gtkmm2ext/bindings.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/libs/gtkmm2ext/bindings.cc b/libs/gtkmm2ext/bindings.cc
index ff44da4b32..7d7d4ed0a6 100644
--- a/libs/gtkmm2ext/bindings.cc
+++ b/libs/gtkmm2ext/bindings.cc
@@ -597,7 +597,20 @@ Bindings::push_to_gtk (KeyboardKey kb, RefPtr<Action> what)
* happens.
*/
- Gtk::AccelMap::add_entry (what->get_accel_path(), kb.key(), (Gdk::ModifierType) kb.state());
+
+ int mod = kb.state();
+#ifdef __APPLE__
+ /* See comments in Keyboard::Keyboard about GTK handling of MOD2, META and the Command key.
+ *
+ * If we do not do this, GTK+ won't show the correct text for shortcuts in menus.
+ */
+
+ if (mod & GDK_MOD2_MASK) {
+ mod = mod | GDK_META_MASK;
+ }
+#endif
+
+ Gtk::AccelMap::add_entry (what->get_accel_path(), kb.key(), (Gdk::ModifierType) mod);
}
}