summaryrefslogtreecommitdiffstats
path: root/source/x11-helper.c
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2015-09-16 21:01:40 +0200
committerQC <qball@gmpclient.org>2015-09-16 21:01:40 +0200
commit558bb3863059d353f8a106979360a66c91325bdb (patch)
treef1b34b016b7ba6d8b426f24d9ff86be947e2373f /source/x11-helper.c
parent176fd15de15d41f640738ac2d2c3fad70178d416 (diff)
Fix normal mode keyboard grab.
Diffstat (limited to 'source/x11-helper.c')
-rw-r--r--source/x11-helper.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/x11-helper.c b/source/x11-helper.c
index d8b9ec2f..33d8897a 100644
--- a/source/x11-helper.c
+++ b/source/x11-helper.c
@@ -286,8 +286,12 @@ int window_send_message ( Display *display, Window target,
return r;
}
+extern unsigned int normal_window_mode;
int take_keyboard ( Display *display, Window w )
{
+ if ( normal_window_mode ) {
+ return 1;
+ }
for ( int i = 0; i < 500; i++ ) {
if ( XGrabKeyboard ( display, w, True, GrabModeAsync, GrabModeAsync, CurrentTime ) == GrabSuccess ) {
return 1;
@@ -300,7 +304,9 @@ int take_keyboard ( Display *display, Window w )
void release_keyboard ( Display *display )
{
- XUngrabKeyboard ( display, CurrentTime );
+ if ( !normal_window_mode ) {
+ XUngrabKeyboard ( display, CurrentTime );
+ }
}
// bind a key combination on a root window, compensating for Lock* states
void x11_grab_key ( Display *display, unsigned int modmask, KeySym key )