source: trunk/third/gnome-panel/doc/panel-keynav.txt @ 18349

Revision 18349, 3.6 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18348, which included commits to RCS files with non-trunk default branches.
Line 
1This note describes areas where implementation of keynav for panels was
2difficult.
3
4- PanelWidget and objects on the panel such as launchers and applets need to
5be focusable
6
7Both the PanelWidget and objects on the panel need to be focusable in order
8to invoke the context menu using only the keyboard. In the normal course of
9things, GTK+ does not support a widget and its children be focusable.
10
11Instead of requiring the PanelWidget be focusable we have introduced a key
12binding Ctrl+F10 which pops up the panel's context menu. So a PanelWidget
13is focusable only when it does not have any children. There is, therefore,
14no need for the key binding Ctrl+Tab to move the focus to the PanelWidget from
15an applet or a launcher.
16
17The function panel_widget_real_focus is PanelWidget's default signal
18handler for focus signal. This function is called when either PanelWidget
19or a child has focus and Tab or arrow keys are used to move focus. If the
20PanelWidget has focus and the PanelWidget has children the GTK_CAN_FOCUS flag
21is unset so that a child can receive focus.
22
23- An applet with a tooltip receives focus
24
25If an applet has a tooltip, the applet willr eceive focus so that the tooltip
26can be displayed, even if the applet contains focusable widgets. The
27focusable widgets in the applet can be traversed using the arrow jeys.
28
29
30- Tab should move focus from within an applet to the next object on the panel
31
32This is implemented by defining an action signal "move_focus_out_of_applet"
33on PanelApplet and binding Tab  and Shift+Tab to this action.
34
35When focus is in an applet the event is passed to the focus widget then its
36children until a toplevel is reached unless the event is handled. This is
37done in gtk_window_key_press_event(). The original implemementation  for
38"move_focus_out_of_applet" had the action signal defined on PanelAppletFrame
39but as a GtkSocket always reports a key press event as being handled when
40the GtkPlug is in a different process, the event has not passed to the
41PanelAppletFrame.
42
43The implementation for "moving_focus_out_of_applet" sets a flag
44moving_focus_out so that the function panel_applet_focus() which is
45PanelApplet's default signal handler for focus signal will not attempt to
46move the focus within the applet if this flag is set.
47
48
49- Implementing key bindings
50
51If focus is in an applet which is in another process, the GtkSocket will
52report the key stroke as having been handled. This means that key bindings
53will not be activated. The workaround for this is to handle those key
54strokes in panel_event() a signal handler for the event signal in panel.c.
55However, we only want to handle some keybindings, for example we do not want
56to handle Shift+F10, which displays the context menu, and Ctrl+F1, which
57displays the tooltip, but we do want to handle Ctrl+F10 which displays the
58panel's context menu.
59
60
61- Focus indication
62
63We need a mechanism that will make visible which panel has focus. We also
64need to do this without impacting current behaviour.
65
66We set the state of a PanelWidget to GTK_STATE_SELECTED whan focus is in a
67PanelWidget. We provide a default panel rc file gnome-panelrc, which is
68installed in $(datadir). This rc file sets the default default color for
69SELECTED for any widget which is a descended from a PanelWidget or
70PanelApplet to be the same as the NORMAL colour.
71
72If there is a requirement to make panel focus indication visible, the
73following lines added to ~/.gtkrc-2.0 will make a selected panel prelight
74color.
75
76style "prelight-selected"
77{
78  fg[SELECTED] = { 0, 0, 0 }
79  bg[SELECTED] = { 0xea60, 0xea60, 0xea60 }
80}
81
82widget_class "*PanelWidget*" style "prelight-selected"
83widget_class "*PanelApplet*" style "prelight-selected"
84
Note: See TracBrowser for help on using the repository browser.