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 741741 - Composer shortcuts not active when embedded and focus not in editor
Composer shortcuts not active when embedded and focus not in editor
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: composer
master
Other Linux
: Normal normal
: 0.13.0
Assigned To: Geary Maintainers
Geary Maintainers
Depends on: 778728
Blocks:
 
 
Reported: 2014-12-19 05:55 UTC by Robert Schroll
Modified: 2019-02-13 14:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Robert Schroll 2014-12-19 05:55:31 UTC
When the composer is embedded, we have to toggle its accelerators on and off, since they are associated with the top-level window.  Evidently, there was no way for us to determine if focus was in the composer as a whole, so we toggle on whether the focus is in the editor component.  This means that these shortcuts are not enabled when focus is in the address entries, for example.

Most of the shortcuts are dealing with editing the message's text, so this is okay.  But the detach and close shortcuts are expected to work form the address entries.  We could

1) Perform the toggle when focus enters any focusable element of the composer.  Presumably this also includes all the buttons.

2) Provide equivalent shortcuts in the main window that check where the focus is before executing.

3) Figure out how to correctly limit shortcuts to a container element.  There must be a way.
Comment 1 Jim Nelson 2014-12-19 21:09:21 UTC
Robert, to be clear, are *all* the shortcut keys in question registered as accelerators?  In the past (we did this too often in Shotwell) we sometimes would capture keyboard events and tie special keys to GtkActions.  Early on we didn't know how to register multiple accelerator keys to the same event.  In other situations, we were capturing keys GTK+ apparently wouldn't bind to accelerators.

I haven't dived into the code, but one thing we (or I, or whomever tackles this ticket) should determine is if this is purely an accelerator problem and not a combination of accelerators/key event handling, as they're different beasts.

In the case of GtkWindow key event handling conflicting with child GtkWidgets, we had that issue in Shotwell and went down the path of #2.  It wasn't pretty, but it worked.
Comment 2 Robert Schroll 2014-12-19 22:46:56 UTC
I believe these are all accelerators.  In the on_focus_(in|out) methods of ComposerEmbed, we add and remove an accelerator group from the top window.  What we want is to tell GTK to use those accelerators whenever the focus is within the ComposerEmbed container, but I couldn't figure out a way to do that.
Comment 3 Michael Gratton 2019-02-13 14:33:44 UTC
Fixed by https://gitlab.gnome.org/GNOME/geary/merge_requests/106