Browse Source

Merge pull request #17 from nylen/ignore-XQueryKeymap-BadValue

Ignore BadValue errors from XQueryKeymap
Dalton Nell 9 years ago
parent
commit
a76714e690
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/x.cpp

+ 6
- 0
src/x.cpp View File

28
         fprintf( stderr, "_X Error \"BadAccess\" for XGrabKeyboard ignored...\n" );
28
         fprintf( stderr, "_X Error \"BadAccess\" for XGrabKeyboard ignored...\n" );
29
         return EXIT_SUCCESS;
29
         return EXIT_SUCCESS;
30
     }
30
     }
31
+    // Ignore XQueryKeymap BadValue errors, we can work without it.
32
+    // 128 = XShape request code, not sure why XQueryKeymap generates this?
33
+    if ( event->request_code == 128 && event->error_code == BadValue ) {
34
+        fprintf( stderr, "_X Error \"BadValue\" for XQueryKeymap ignored...\n" );
35
+        return EXIT_SUCCESS;
36
+    }
31
     // Everything else should be fatal as I don't like undefined behavior.
37
     // Everything else should be fatal as I don't like undefined behavior.
32
     char buffer[1024];
38
     char buffer[1024];
33
     XGetErrorText( dpy, event->error_code, buffer, 1024 );
39
     XGetErrorText( dpy, event->error_code, buffer, 1024 );