do not call MidiRingBuffer::skip_to() when getting a MidiDiskstream's playback buffer...
[ardour.git] / libs / gtkmm2ext / bindings.cc
index ff44da4b32c5487d6cf8be2e4f4d7681e4370a33..e25ed20f210db3804b578340e0b3b840869352b4 100644 (file)
@@ -179,14 +179,16 @@ KeyboardKey::display_label () const
 
 #ifdef __APPLE__
        /* We use both bits (MOD2|META) for Primary on OS X,
-        * but we don't want MOD2 showing up in listings.
+        * but we don't want MOD2 showing up in listings. So remove
+        * it and add back META.
         */
 
        if (mod & GDK_MOD2_MASK) {
-               mod &= ~GDK_MOD2_MASK;
+               mod = (mod & ~GDK_MOD2_MASK) | GDK_META_MASK;
        }
 #endif
 
+
        return gtk_accelerator_get_label (key(), (GdkModifierType) mod);
 }
 
@@ -597,7 +599,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);
        }
 }
 
@@ -628,10 +643,10 @@ Bindings::add (KeyboardKey kb, Operation op, string const& action_name, XMLPrope
        KeybindingMap& kbm = get_keymap (op);
        if (group) {
                KeybindingMap::value_type new_pair = make_pair (kb, ActionInfo (action_name, group->value()));
-               kbm.insert (new_pair).first;
+               (void) kbm.insert (new_pair).first;
        } else {
                KeybindingMap::value_type new_pair = make_pair (kb, ActionInfo (action_name));
-               kbm.insert (new_pair).first;
+               (void) kbm.insert (new_pair).first;
        }
 
        if (can_save) {