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 473786 - Needs keyboard navigation for gtkstatusicon
Needs keyboard navigation for gtkstatusicon
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 103223 431030
 
 
Reported: 2007-09-05 04:33 UTC by Li Yuan
Modified: 2011-01-15 17:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to enable keyboard navigation on gtkstatusicon (3.57 KB, patch)
2007-09-05 04:34 UTC, Li Yuan
needs-work Details | Review
new patch (3.70 KB, patch)
2007-12-21 08:45 UTC, Li Yuan
none Details | Review
updated patch (4.03 KB, patch)
2008-01-16 19:04 UTC, Christian Persch
committed Details | Review

Description Li Yuan 2007-09-05 04:33:08 UTC
gtkstatusicon is missing keyboard navigation currently.
Comment 1 Li Yuan 2007-09-05 04:34:58 UTC
Created attachment 94971 [details] [review]
patch to enable keyboard navigation on gtkstatusicon
Comment 2 Li Yuan 2007-09-05 05:09:24 UTC
Hi Matthias,

Would you like to look at this patch?

Li
Comment 3 Behdad Esfahbod 2007-09-05 05:14:14 UTC
(In reply to comment #2)
> Hi Matthias,
> 
> Would you like to look at this patch?
> 
> Li

Matthias (and all other relevant hackers) read incoming bugs.  No need to ping or CC individually.
Comment 4 Matthias Clasen 2007-09-06 19:58:28 UTC
Nice. But it doesn't work quite right yet, in my testing.

When I C-A-Tab to move the focus to the panel, and then Tab/arrow all the way to the teststatusicon icon, space will pop up the dialog, but it doesn't get focus,
and the menu key does not post the menu.

After this failed attempt, the focus moves somewhere else, usually a terminal.

Retrying C-A-Tab in that situation directly puts the focus on the teststatusicon icon again, and then space/enter/menu key work as expected.
Comment 5 Matthias Clasen 2007-09-06 20:00:45 UTC
not sure if this is a problem in the patch itself, or in the notification area code.
Comment 6 Li Yuan 2007-09-07 03:21:24 UTC
(In reply to comment #4)
> Nice. But it doesn't work quite right yet, in my testing.
> 
> When I C-A-Tab to move the focus to the panel, and then Tab/arrow all the way
> to the teststatusicon icon, space will pop up the dialog, but it doesn't get
> focus,
> and the menu key does not post the menu.
> 

Everything is fine on my system... I moved the focus to the teststatusicon icon, pressed space, the dialog popped up, and it got the focus, alt+space would popup the windown menu.

I am trying on Ubuntu, gnome 2.19.6.

Comment 7 Li Yuan 2007-09-07 03:26:49 UTC
By the way, I disabled the "change images" option in teststatusicon. This option will change the icon to another without focus. I believe this is another bug.
Comment 8 Matthias Clasen 2007-11-26 14:53:25 UTC
I'll look at this again
Comment 9 Christian Persch 2007-12-20 15:16:34 UTC
+  if (event->keyval == GDK_Return || event->keyval == GDK_space)

I think this should check that (event->state & gtk_accelerator_get_default_mod_mask == 0). And also there's more keys to check for, e.g. GDK_ISO_Enter and GDK_KP_Enter.

And I think this should be done through the classes' binding set instead of using the keypress handler.
Comment 10 Li Yuan 2007-12-21 08:45:48 UTC
Created attachment 101383 [details] [review]
new patch
Comment 11 Li Yuan 2007-12-21 08:53:38 UTC
I don't use the binding set because we listen to trayicon's keypress signal, but emit statusicon's active signal. If we add bindings to trayicon, it's hard to get statusicon.
Comment 12 Li Yuan 2008-01-07 07:27:21 UTC
Ping chpe, how about the new version of patch?
Comment 13 Christian Persch 2008-01-16 19:04:34 UTC
Created attachment 103012 [details] [review]
updated patch

Not sure if focus painting should take interior-focus, focus-line-width and focus-padding into account; otherwise this looks ready.
Comment 14 Li Yuan 2008-01-18 08:24:12 UTC
Matthias, do you have any suggestion?
Comment 15 Matthias Clasen 2008-02-12 03:28:12 UTC
Trying it again, it seems to work ok now. After applying this patch there is now the new problem that the notification area has no separate focus location of its own anymore, I think. This makes it e.g. impossible to move the notification area using keynav. But that is not a GTK+ bug.

2008-02-11  Matthias Clasen  <mclasen@redhat.com>

        Support keynav in status icons.  (#473786, Li Yuan)

        * gtk/gtkstatusicon.c: Handle keynav, make the tray icon focusable.

        * gtk/gtktrayicon-x11.c: Draw a focus rectangle when focused.

Comment 16 Li Yuan 2008-02-15 07:45:28 UTC
Thanks! This is a very important bug for us.