mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-25 13:55:34 -05:00
Fix grab keyboard to wait on success.
This commit is contained in:
parent
6d0d6d9eb2
commit
460cad8bc8
1 changed files with 6 additions and 2 deletions
|
@ -313,13 +313,17 @@ int take_keyboard ( xcb_connection_t *xcb_connection, xcb_window_t w )
|
||||||
{
|
{
|
||||||
|
|
||||||
for ( int i = 0; i < 500; i++ ) {
|
for ( int i = 0; i < 500; i++ ) {
|
||||||
xcb_grab_keyboard_cookie_t cc = xcb_grab_keyboard ( xcb_connection, 1, w, XCB_CURRENT_TIME, XCB_GRAB_MODE_ASYNC,
|
xcb_grab_keyboard_cookie_t cc = xcb_grab_keyboard ( xcb_connection,
|
||||||
|
1, w, XCB_CURRENT_TIME, XCB_GRAB_MODE_ASYNC,
|
||||||
XCB_GRAB_MODE_ASYNC);
|
XCB_GRAB_MODE_ASYNC);
|
||||||
xcb_grab_keyboard_reply_t *r = xcb_grab_keyboard_reply ( xcb_connection, cc, NULL);
|
xcb_grab_keyboard_reply_t *r = xcb_grab_keyboard_reply ( xcb_connection, cc, NULL);
|
||||||
if ( r ) {
|
if ( r ) {
|
||||||
free ( r );
|
if ( r->status == XCB_GRAB_STATUS_SUCCESS) {
|
||||||
|
free(r);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
free ( r );
|
||||||
|
}
|
||||||
usleep ( 1000 );
|
usleep ( 1000 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue