diff options
author | Gary Wong <gtw@gnu.org> | 2009-09-01 20:51:40 -0600 |
---|---|---|
committer | Gary Wong <gtw@gnu.org> | 2009-09-01 20:51:40 -0600 |
commit | db6024a4eb1f55605e344d9cb640424038a239be (patch) | |
tree | e453835cc097c67441d2de2dba60dd0c87b13a8d /root.c | |
parent | 86c8dfa5b8017f7a940ed2e7333ee27a4af199a8 (diff) |
Add simple menu handling.
Diffstat (limited to 'root.c')
-rw-r--r-- | root.c | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -43,7 +43,11 @@ static void root_key_press( struct gwm_window *window, if( keyboard_map[ ev->detail ][ 0 ] == key_actions[ i ].keysym && ( ev->state & 0xFF & key_actions[ i ].modifiers ) == key_actions[ i ].modifiers ) { - key_actions[ i ].handler( window, (xcb_generic_event_t *) ev ); + union callback_param cp; + + cp.p = NULL; + key_actions[ i ].handler( focus_frame ? focus_frame : window, + (xcb_generic_event_t *) ev, cp ); break; } @@ -52,10 +56,12 @@ static void root_key_press( struct gwm_window *window, static const struct button_action { int button; xcb_mod_mask_t modifiers; - void ( *handler )( struct gwm_window *window, xcb_generic_event_t *ev ); + void ( *handler )( struct gwm_window *window, xcb_generic_event_t *ev, + union callback_param cp ); } button_actions[] = { /* FIXME This table should be configurable, of course. */ - { 1, 0, action_map_all_icons }, + { 1, 0, action_root_menu }, + { 2, 0, action_map_all_icons }, { 3, 0, action_start_xterm } }; @@ -73,7 +79,11 @@ static void root_button_press( struct gwm_window *window, if( ev->detail == button_actions[ i ].button && ( ev->state & 0xFF & button_actions[ i ].modifiers ) == button_actions[ i ].modifiers ) { - button_actions[ i ].handler( window, (xcb_generic_event_t *) ev ); + union callback_param cp; + + cp.p = NULL; + button_actions[ i ].handler( window, (xcb_generic_event_t *) ev, + cp ); break; } |