summaryrefslogtreecommitdiffstats
path: root/source/view.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-11-06 16:50:12 +0100
committerDave Davenport <qball@gmpclient.org>2016-11-06 16:50:12 +0100
commit89e3e0e64584d317239e97d56e7d0b992c01ee58 (patch)
tree6311b235487aefda8c7c36e7c7c8d7744d89ddb4 /source/view.c
parent0554db65eace93d9c589c04ef12ad57c2c73b7b0 (diff)
Grab keyboard as early as possible (#494)
Diffstat (limited to 'source/view.c')
-rw-r--r--source/view.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/source/view.c b/source/view.c
index d58c7062..babd3ce7 100644
--- a/source/view.c
+++ b/source/view.c
@@ -1349,21 +1349,6 @@ RofiViewState *rofi_view_create ( Mode *sw,
TICK_N ( "Startup notification" );
- // Try to grab the keyboard as early as possible.
- // We grab this using the rootwindow (as dmenu does it).
- // this seems to result in the smallest delay for most people.
- if ( ( CacheState.flags & MENU_NORMAL_WINDOW ) == 0 ) {
- int has_keyboard = take_keyboard ( xcb_stuff_get_root_window ( xcb ) );
-
- if ( !has_keyboard ) {
- fprintf ( stderr, "Failed to grab keyboard, even after %d uS.", 500 * 1000 );
- // Break off.
- rofi_view_free ( state );
- return NULL;
- }
- take_pointer ( xcb_stuff_get_root_window ( xcb ) );
- }
- TICK_N ( "Grab keyboard" );
// Get active monitor size.
TICK_N ( "Get active monitor" );
@@ -1494,17 +1479,6 @@ int rofi_view_error_dialog ( const char *msg, int markup )
state->menu_flags = MENU_ERROR_DIALOG;
state->finalize = process_result;
- // Try to grab the keyboard as early as possible.
- // We grab this using the rootwindow (as dmenu does it).
- // this seems to result in the smallest delay for most people.
- if ( ( CacheState.flags & MENU_NORMAL_WINDOW ) == 0 ) {
- int has_keyboard = take_keyboard ( xcb_stuff_get_root_window ( xcb ) );
- if ( !has_keyboard ) {
- fprintf ( stderr, "Failed to grab keyboard, even after %d uS.", 500 * 1000 );
- return FALSE;
- }
- take_pointer ( xcb_stuff_get_root_window ( xcb ) );
- }
rofi_view_calculate_window_and_element_width ( state );
state->main_box = box_create ( BOX_VERTICAL,