GNOME Bugzilla – Bug 750465
Shell modal dialog mnemonic support
Last modified: 2021-07-05 14:39:55 UTC
Created attachment 304666 [details] screenshot of gcr-based pinentry under GNOME 3 Depending on the desktop environment and the type of UX widget, gcr system prompts only sometimes enable keyboard shortcut accelerators. under GNOME 3, gcr buttons labeled with the string "_OK" display the full string (with the literal underscore), and cannot be "clicked" from the keyboard with ALT+O. Under XFCE4, gcr buttons labeled with the string "_OK" display the string as "OK" and can be "clicked" from the keyboard with ALT+O. When an option is presented to the user via gcr_prompt_set_choice_label() with an underscore in it, both desktop environments display the literal underscore, and neither of them enable keyboard shortcuts to the choice checkbox. It would be great if gcr could enable the keyboard accelerators for all widgets under all desktop environments based on leading underscores, the way that buttons in the xfce4 context work.
As far as I can tell there's no support (or design) for mnemonics in the system modal gnome-shell prompts. So if gnome-shell doesn't want mnemonics displayed (by design) then we should probably strip them out in gcr. Alternatively gnome-shell (and it's ST toolkit) would gain support for button mnemonics. A gnome-shell developer or designer would need to make the call here.
Yuuma, would you be interested in contributing a patch to gnome-shell which strips out the mnemonics? I think the relevant change would be in src/shell-keyring-prompt.c
Created attachment 304736 [details] [review] Strip out mnemonics indicator from ShellKeyringPrompt Sure, Please check if attached patch is enough, works for me.
Review of attachment 304736 [details] [review]: Other than that, looks good. ::: src/shell-keyring-prompt.c @@ +131,3 @@ + while (*label != '\0') + { + if (*label == mnemonic) A double underscore should be translated to an underscore. See documentation for gtk_button_new_mnemonic() and friends.
Errm, so we actively remove a (non-working) accessibility feature here? Has this been discussed with the GNOME a11y folks?
It's currently a non-feature. If such a feature is desired, it should be added, and I don't mind this bug being used as a tracker for such a feature. The first patch just maintains the status-quo and fixes the regression that results from bug #750514.
(In reply to Stef Walter from comment #4) > Review of attachment 304736 [details] [review] [review]: > > Other than that, looks good. > > ::: src/shell-keyring-prompt.c > @@ +131,3 @@ > + while (*label != '\0') > + { > + if (*label == mnemonic) > > A double underscore should be translated to an underscore. See documentation > for gtk_button_new_mnemonic() and friends. The next character to an underscore is copied to output, even if it is an underscore.
Review of attachment 304736 [details] [review]: In that case looks good to me. We probably want someone in gnome-shell to cross check this, and then I can push it.
Review of attachment 304736 [details] [review]: Looks good to me as well, except for a minor style issue ::: src/shell-keyring-prompt.c @@ +133,3 @@ + if (*label == mnemonic) + { + label++; No braces around one-line blocks: if (*label == mnemonic) label++;
Thanks Florian. Made minor style fix and pushed the interim fix patch to master. The mnemonics are now stripped out. Lets leave this bug open for the gnome-shell guys to make a call about use of mnemonics in system modal prompts.
bug #752328 has been opened about mnemonics in gcr.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/ Thank you for your understanding and your help.