Bläddra i källkod

fixed slop crashing when failing to grab keyboard for real

naelstrof 7 år sedan
förälder
incheckning
3a70901e0a
3 ändrade filer med 3 tillägg och 9 borttagningar
  1. 1
    1
      CMakeLists.txt
  2. 1
    1
      src/keyboard.cpp
  3. 1
    7
      src/slop.cpp

+ 1
- 1
CMakeLists.txt Visa fil

@@ -21,7 +21,7 @@ endif()
21 21
 
22 22
 include_directories("${PROJECT_BINARY_DIR}")
23 23
 
24
-add_definitions(-DSLOP_VERSION="v5.3.29")
24
+add_definitions(-DSLOP_VERSION="v5.3.30")
25 25
 
26 26
 # The names have to be unique unfortunately.
27 27
 set(EXECUTABLE_NAME "slop")

+ 1
- 1
src/keyboard.cpp Visa fil

@@ -42,7 +42,7 @@ slop::Keyboard::Keyboard( X11* x11 ) {
42 42
     this->x11 = x11;
43 43
     int err = XGrabKeyboard( x11->display, x11->root, False, GrabModeAsync, GrabModeAsync, CurrentTime );
44 44
     if ( err != GrabSuccess ) {
45
-        throw new std::runtime_error( "Failed to grab keyboard.\n" );
45
+        //throw new std::runtime_error( "Failed to grab keyboard.\n" );
46 46
     }
47 47
     XQueryKeymap( x11->display, deltaState );
48 48
     keyDown = false;

+ 1
- 7
src/slop.cpp Visa fil

@@ -74,13 +74,7 @@ slop::SlopSelection slop::SlopSelect( slop::SlopOptions* options, bool* cancelle
74 74
     // Set up x11 temporarily
75 75
     x11 = new X11(options->xdisplay);
76 76
     XErrorHandler ph = XSetErrorHandler(slop::TmpXError);
77
-    try {
78
-        keyboard = new Keyboard( x11 );
79
-    } catch (...) {
80
-        if ( !quiet && !options->nokeyboard) {
81
-            std::cerr << "Failed to grab keyboard, continuing...\n";
82
-        }
83
-    }
77
+    keyboard = new Keyboard( x11 );
84 78
     XSetErrorHandler(ph);
85 79
     bool success = false;
86 80
     std::string errorstring = "";