summaryrefslogtreecommitdiffstats
path: root/source/x11-helper.c
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2015-05-02 12:42:36 +0200
committerQC <qball@gmpclient.org>2015-05-02 12:42:36 +0200
commita974db887a88dfd56546bf9af6c7a7e762ba6746 (patch)
tree04f387873a4df0082674039a126a1b8828d6c3a6 /source/x11-helper.c
parentab715bf6b60a9040c6aaa76d10bcef3a1720d42e (diff)
Fix issue #153.
Diffstat (limited to 'source/x11-helper.c')
-rw-r--r--source/x11-helper.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/x11-helper.c b/source/x11-helper.c
index 86cbe50c..0341dbbb 100644
--- a/source/x11-helper.c
+++ b/source/x11-helper.c
@@ -243,8 +243,11 @@ int window_send_message ( Display *display, Window target,
int take_keyboard ( Display *display, Window w )
{
- if ( XGrabKeyboard ( display, w, True, GrabModeAsync, GrabModeAsync, CurrentTime ) == GrabSuccess ) {
- return 1;
+ for ( int i = 0; i < 500; i++) {
+ if ( XGrabKeyboard ( display, w, True, GrabModeAsync, GrabModeAsync, CurrentTime ) == GrabSuccess ) {
+ return 1;
+ }
+ usleep ( 1000 );
}
return 0;