GNOME Bugzilla – Bug 473786
Needs keyboard navigation for gtkstatusicon
Last modified: 2011-01-15 17:36:01 UTC
gtkstatusicon is missing keyboard navigation currently.
Created attachment 94971 [details] [review] patch to enable keyboard navigation on gtkstatusicon
Hi Matthias, Would you like to look at this patch? Li
(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.
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.
not sure if this is a problem in the patch itself, or in the notification area code.
(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.
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.
I'll look at this again
+ 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.
Created attachment 101383 [details] [review] new patch
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.
Ping chpe, how about the new version of patch?
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.
Matthias, do you have any suggestion?
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.
Thanks! This is a very important bug for us.