Browse Source

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

Ignore BadValue errors from XQueryKeymap
Dalton Nell 10 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,6 +28,12 @@ int slop::XEngineErrorHandler( Display* dpy, XErrorEvent* event ) {
28 28
         fprintf( stderr, "_X Error \"BadAccess\" for XGrabKeyboard ignored...\n" );
29 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 37
     // Everything else should be fatal as I don't like undefined behavior.
32 38
     char buffer[1024];
33 39
     XGetErrorText( dpy, event->error_code, buffer, 1024 );