GNOME Bugzilla – Bug 743282
Special Characters and Start Dictation accelerators don't work.
Last modified: 2021-05-25 10:04:51 UTC
on OS X if application has accelerators connected to menu action and shortcut is plain letter, then keystroke instead of going into input/edit field is intercepted by accelerator and corresponding menu action is performed. Expected result: when focus is in input/edit field, plain letter keystrokes shouldn't be intercepted by accelerators like it works on linux.
Make sure that you call gtkosx_application_set_use_quartz_accelerators (theApp, FALSE); in your setup code. This will also ensure that bindings override accelerators when that's appropriate. However it disables the accelerators in the Apple Menu for hiding the app or all other apps.
(In reply to comment #1) > Make sure that you call > gtkosx_application_set_use_quartz_accelerators (theApp, FALSE); > in your setup code. This will also ensure that bindings override accelerators > when that's appropriate. However it disables the accelerators in the Apple Menu > for hiding the app or all other apps. It did the trick, even hiding the app or all other apps works, only Cmd-Q didn't. But if I manually specify: (gtk_accel_path "<Actions>/Menu/File/Exit" "<Primary>q") in menurc, then menu shows this Exit item as with Q shortcut but, pressing Q does nothing, however Cmd-Q works. It's a bit wierd but at leas gives expected result. On Mac you quickly get addicted to Cmd-Q way of closing apps. What doesn't work is: "Special characters ... ^-Cmd-Space" shortcut.
Are you sure about cmd-H and opt-cmd-H working and cmd-Q not working? I've never seen that. I've never found any way to stop quartz from responding to cmd-Q except a hang. Cmd-Q is special for quartz. AFAIK there's no way to override or change it. <primary>Q means cmd-Q on Mac and ctrl-Q everywhere else. I suspect that the quartz is eating the cmd prefix on the menu item because cmd-Q is already taken, and quartz grabs that and sends NSApplicationWillTerminate without passing it on to GDK. Meanwhile GDK doesn't recognize plain Q as an accelerator because you told it that the accelerator is cmd-Q. What exactly did you try to set for an accelerator for your "Special Characters..." menu item?
(In reply to comment #3) > Are you sure about cmd-H and opt-cmd-H working and cmd-Q not working? I've It definitely works, at least that what happens on my system (OS X 10.10.1 for that matter) > never seen that. I've never found any way to stop quartz from responding to > cmd-Q except a hang. > > Cmd-Q is special for quartz. AFAIK there's no way to override or change it. > <primary>Q means cmd-Q on Mac and ctrl-Q everywhere else. I suspect that the > quartz is eating the cmd prefix on the menu item because cmd-Q is already > taken, and quartz grabs that and sends NSApplicationWillTerminate without > passing it on to GDK. Meanwhile GDK doesn't recognize plain Q as an accelerator > because you told it that the accelerator is cmd-Q. correction of Cmd-Q explicit assignment for comment 2, File/Exit actually doesn't show that any accelerator assigned to it but Cmd-Q works as expected. > What exactly did you try to set for an accelerator for your "Special > Characters..." menu item? nothing explicit, it's default shortcut of default OS X menu item.
(In reply to comment #4) > correction of Cmd-Q explicit assignment for comment 2, File/Exit actually > doesn't show that any > accelerator assigned to it but Cmd-Q works as expected. Sorry, I don't understand you. > > > What exactly did you try to set for an accelerator for your "Special > > Characters..." menu item? > nothing explicit, it's default shortcut of default OS X menu item. None of the OSX menu items are carried over to Gtk apps except the ones in the application menu. No menu item, no accelerator.
(In reply to comment #5) > (In reply to comment #4) > > correction of Cmd-Q explicit assignment for comment 2, File/Exit actually > > doesn't show that any > > accelerator assigned to it but Cmd-Q works as expected. > > Sorry, I don't understand you. I've mean that (gtk_accel_path "<Actions>/Menu/File/Exit" "<Primary>q") makes Cmd-Q work but there isn't accelerator next to "File/Exit" menu item. > > > > > > What exactly did you try to set for an accelerator for your "Special > > > Characters..." menu item? > > nothing explicit, it's default shortcut of default OS X menu item. > > None of the OSX menu items are carried over to Gtk apps except the ones in the > application menu. No menu item, no accelerator. Well that's what I observe on OS X 10.10, every native application has following items in "Edit" menu: Start Dictation... fn fn Special Characters... ^-CMD-Space And they are present in ported claws-mail (which doesn't add them explicitly)
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > correction of Cmd-Q explicit assignment for comment 2, File/Exit actually > > > doesn't show that any > > > accelerator assigned to it but Cmd-Q works as expected. > > > > Sorry, I don't understand you. > I've mean that > (gtk_accel_path "<Actions>/Menu/File/Exit" "<Primary>q") > makes Cmd-Q work but there isn't accelerator next to "File/Exit" menu item. And I explained why that is in comment 3. > > > > > > > > > > What exactly did you try to set for an accelerator for your "Special > > > > Characters..." menu item? > > > nothing explicit, it's default shortcut of default OS X menu item. > > > > None of the OSX menu items are carried over to Gtk apps except the ones in the > > application menu. No menu item, no accelerator. > > Well that's what I observe on OS X 10.10, every native application has > following items in > "Edit" menu: > Start Dictation... fn fn > Special Characters... ^-CMD-Space > And they are present in ported claws-mail (which doesn't add them explicitly) Huh. I'd never noticed that before. The accelerator doesn't work because there's no Gtk event to process it. There's a bit of a catch, too, because the accelerator changes with version. It's ctrl-cmd-space on 10.9 and 10.10, was shift-cmd-T on 10.7 (I don't have a 10.8 VM to check there), and didn't have an accelerator at all on 10.6. That will take some work. I've retitled the bug report for that.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk-mac-integration/-/issues/12.