diff --git a/include/x11-helper.h b/include/x11-helper.h index 76698a1e..c34d907b 100644 --- a/include/x11-helper.h +++ b/include/x11-helper.h @@ -183,8 +183,22 @@ void release_keyboard ( Display *display ); */ int take_keyboard ( Display *display, Window w ); +/** + * @param display Connection to the X server. + * @param modmask Modifier mask. + * @param key Key. + * + * Grab key on display. + */ +void x11_grab_key ( Display *display, unsigned int modmask, KeySym key ); -void grab_key ( Display *display, unsigned int modmask, KeySym key ); +/** + * @param combo String representing the key combo + * @param mod [out] The modifier specified (or AnyModifier if not specified) + * @param key [out] The key specified + * + * Parse key from user input string. + */ void x11_parse_key ( char *combo, unsigned int *mod, KeySym *key ); /** diff --git a/source/rofi.c b/source/rofi.c index 56227b3f..8c992120 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -2034,17 +2034,17 @@ int main ( int argc, char *argv[] ) // Daemon mode, Listen to key presses.. if ( switcher_get ( "window" ) >= 0 ) { x11_parse_key ( config.window_key, &windows_modmask, &windows_keysym ); - grab_key ( display, windows_modmask, windows_keysym ); + x11_grab_key ( display, windows_modmask, windows_keysym ); } if ( switcher_get ( "run" ) >= 0 ) { x11_parse_key ( config.run_key, &rundialog_modmask, &rundialog_keysym ); - grab_key ( display, rundialog_modmask, rundialog_keysym ); + x11_grab_key ( display, rundialog_modmask, rundialog_keysym ); } if ( switcher_get ( "ssh" ) >= 0 ) { x11_parse_key ( config.ssh_key, &sshdialog_modmask, &sshdialog_keysym ); - grab_key ( display, sshdialog_modmask, sshdialog_keysym ); + x11_grab_key ( display, sshdialog_modmask, sshdialog_keysym ); } // Setup handler for sighub (reload config) diff --git a/source/x11-helper.c b/source/x11-helper.c index 00411e81..8c9f3987 100644 --- a/source/x11-helper.c +++ b/source/x11-helper.c @@ -398,7 +398,7 @@ void release_keyboard ( Display *display ) XUngrabKeyboard ( display, CurrentTime ); } // bind a key combination on a root window, compensating for Lock* states -void grab_key ( Display *display, unsigned int modmask, KeySym key ) +void x11_grab_key ( Display *display, unsigned int modmask, KeySym key ) { Screen *screen = DefaultScreenOfDisplay ( display ); Window root = RootWindow ( display, XScreenNumberOfScreen ( screen ) );