After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743282 - Special Characters and Start Dictation accelerators don't work.
Special Characters and Start Dictation accelerators don't work.
Status: RESOLVED OBSOLETE
Product: gtk-mac-integration
Classification: Other
Component: General
2.0.x
Other Mac OS
: Normal major
: ---
Assigned To: GTK Mac Integration Maintainers
GTK Mac Integration Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-21 09:32 UTC by Igor Mammedov
Modified: 2021-05-25 10:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Igor Mammedov 2015-01-21 09:32:01 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.
Comment 1 John Ralls 2015-01-21 14:47:43 UTC
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.
Comment 2 Igor Mammedov 2015-01-21 23:23:38 UTC
(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.
Comment 3 John Ralls 2015-01-22 01:40:34 UTC
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?
Comment 4 Igor Mammedov 2015-01-22 09:29:56 UTC
(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.
Comment 5 John Ralls 2015-01-22 15:34:16 UTC
(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.
Comment 6 Igor Mammedov 2015-01-22 16:07:07 UTC
(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)
Comment 7 John Ralls 2015-01-22 17:26:08 UTC
(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.
Comment 8 GNOME Infrastructure Team 2021-05-25 10:04:51 UTC
-- 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.