#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);
}
* 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);
}
}
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) {