|
@@ -25,6 +25,10 @@ Resource* resource;
|
25
|
25
|
SlopSelection GLSlopSelect( slop::SlopOptions* options, bool* cancelled, slop::SlopWindow* window );
|
26
|
26
|
SlopSelection XShapeSlopSelect( slop::SlopOptions* options, bool* cancelled);
|
27
|
27
|
|
|
28
|
+static int TmpXError(Display * d, XErrorEvent * ev) {
|
|
29
|
+ return 0;
|
|
30
|
+}
|
|
31
|
+
|
28
|
32
|
}
|
29
|
33
|
|
30
|
34
|
using namespace slop;
|
|
@@ -69,7 +73,15 @@ slop::SlopSelection slop::SlopSelect( slop::SlopOptions* options, bool* cancelle
|
69
|
73
|
resource = new Resource();
|
70
|
74
|
// Set up x11 temporarily
|
71
|
75
|
x11 = new X11(options->xdisplay);
|
72
|
|
- keyboard = new Keyboard( x11 );
|
|
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
|
+ }
|
|
84
|
+ XSetErrorHandler(ph);
|
73
|
85
|
bool success = false;
|
74
|
86
|
std::string errorstring = "";
|
75
|
87
|
SlopWindow* window;
|