before pushing keybindings to GTK for menu display, make sure that we add back the...
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 18 Jul 2016 18:42:13 +0000 (14:42 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 18 Jul 2016 18:42:13 +0000 (14:42 -0400)
libs/gtkmm2ext/bindings.cc

index ff44da4b32c5487d6cf8be2e4f4d7681e4370a33..7d7d4ed0a6ee722026db4668da8b39b57ca12bfa 100644 (file)
@@ -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);
        }
 }