mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-03 20:29:35 +01:00
Fix setting command key bindings on OSX.
This commit is contained in:
parent
af1a064ebf
commit
4166b05bda
4 changed files with 30 additions and 19 deletions
|
|
@ -450,24 +450,7 @@ ARDOUR_UI_UTILS::key_press_focus_accelerator_handler (Gtk::Window& window, GdkEv
|
|||
GdkModifierType mod = GdkModifierType (ev->state);
|
||||
|
||||
mod = GdkModifierType (mod & gtk_accelerator_get_default_mod_mask());
|
||||
#ifdef GTKOSX
|
||||
/* GTK on OS X is currently (February 2012) setting both
|
||||
the Meta and Mod2 bits in the event modifier state if
|
||||
the Command key is down.
|
||||
|
||||
gtk_accel_groups_activate() does not invoke any of the logic
|
||||
that gtk_window_activate_key() will that sorts out that stupid
|
||||
state of affairs, and as a result it fails to find a match
|
||||
for the key event and the current set of accelerators.
|
||||
|
||||
to fix this, if the meta bit is set, remove the mod2 bit
|
||||
from the modifier. this assumes that our bindings use Primary
|
||||
which will have set the meta bit in the accelerator entry.
|
||||
*/
|
||||
if (mod & GDK_META_MASK) {
|
||||
mod = GdkModifierType (mod & ~GDK_MOD2_MASK);
|
||||
}
|
||||
#endif
|
||||
Gtkmm2ext::possibly_translate_mod_to_make_legal_accelerator(mod);
|
||||
|
||||
if (allow_activating && gtk_accel_groups_activate(G_OBJECT(win), fakekey, mod)) {
|
||||
DEBUG_TRACE (DEBUG::Accelerators, "\taccel group activated by fakekey\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue