changes to adapt to modified version of GTK/Quartz which uses only MOD2 for Command...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 13 Dec 2016 11:22:51 +0000 (06:22 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 13 Dec 2016 12:02:08 +0000 (07:02 -0500)
The default version of GTK2/Quartz uses MOD2+META for keys and MOD2 for scroll, which is
basically insane

libs/gtkmm2ext/bindings.cc
libs/gtkmm2ext/gtkapplication_quartz.mm
libs/gtkmm2ext/keyboard.cc

index 9100ddabc6bd73720860fa21812f13904e028e8f..2b1762da9088eba86aec456ee9a72299d2e4c2d8 100644 (file)
@@ -177,18 +177,6 @@ KeyboardKey::display_label () const
 
        uint32_t mod = state();
 
-#ifdef __APPLE__
-       /* We use both bits (MOD2|META) for Primary on OS X,
-        * but we don't want MOD2 showing up in listings. So remove
-        * it and add back META.
-        */
-
-       if (mod & GDK_MOD2_MASK) {
-               mod = (mod & ~GDK_MOD2_MASK) | GDK_META_MASK;
-       }
-#endif
-
-
        return gtk_accelerator_get_label (key(), (GdkModifierType) mod);
 }
 
@@ -601,16 +589,6 @@ Bindings::push_to_gtk (KeyboardKey kb, RefPtr<Action> what)
 
 
                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);
        }
index 5809355ad9fa9c8d0a53f396ca72a03f45bb81e0..c845db90b71d5b96d40adb94c51ce4859b53a080 100644 (file)
@@ -878,9 +878,9 @@ cocoa_menu_item_update_accelerator (NSMenuItem *cocoa_item,
                                        modifiers |= NSControlKeyMask;
                                }
                                
-                               /* gdk/quartz maps Command to Meta (XXX check this - it may move to SUPER at some point) */
+                               /* our modified gdk/quartz maps Command to Mod2 */
                                
-                               if (key->accel_mods & GDK_META_MASK) {
+                               if (key->accel_mods & GDK_MOD2_MASK) {
                                        modifiers |= NSCommandKeyMask;
                                }
                        }  
index 6417596dad93a9fb005901c1e7f249812bd13ff8..69f682642c834169b8d06bd5a7a6afa6f216a1a1 100644 (file)
@@ -60,7 +60,7 @@ guint Keyboard::insert_note_mod = GDK_CONTROL_MASK;
 
 #ifdef __APPLE__
 
-uint Keyboard::PrimaryModifier = (GDK_MOD2_MASK|GDK_META_MASK);   // Command
+guint Keyboard::PrimaryModifier = GDK_MOD2_MASK;   // Command
 guint Keyboard::SecondaryModifier = GDK_CONTROL_MASK; // Control
 guint Keyboard::TertiaryModifier = GDK_SHIFT_MASK; // Shift
 guint Keyboard::Level4Modifier = GDK_MOD1_MASK; // Alt/Option