Changeset 1293 for code/trunk/src/core/SignalHandler.cc
- Timestamp:
- May 15, 2008, 5:44:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/SignalHandler.cc
r1062 r1293 35 35 36 36 #include <assert.h> 37 #include <iostream> 37 38 38 39 #include "Debug.h" … … 43 44 44 45 #include <wait.h> 46 #include <X11/Xlib.h> 47 #include <X11/Xutil.h> 48 #include <X11/keysym.h> 49 50 bool SignalHandler::bXAutoKeyRepeatOn_ = false; 45 51 46 52 SignalHandler::SignalHandler() … … 58 64 this->fileName = fileName; 59 65 66 // prepare for restoring XAutoKeyRepeat 67 Display* display; 68 if ((display = XOpenDisplay(0))) 69 { 70 XKeyboardState oldState; 71 XGetKeyboardControl(display, &oldState); 72 if (oldState.global_auto_repeat == AutoRepeatModeOn) 73 bXAutoKeyRepeatOn_ = true; 74 else 75 bXAutoKeyRepeatOn_ = false; 76 XCloseDisplay(display); 77 } 78 else 79 { 80 std::cout << "Warning: couldn't open X display to restore XAutoKeyRepeat." << std::endl; 81 bXAutoKeyRepeatOn_ = false; 82 } 83 84 60 85 // make sure doCatch is only called once without calling dontCatch 61 86 assert( sigRecList.size() == 0 ); … … 120 145 sigName = "SIGILL"; 121 146 break; 147 } 148 149 if (bXAutoKeyRepeatOn_) 150 { 151 std::cout << "Trying to restore XAutoKeyRepeat" << std::endl; 152 Display* display; 153 if ((display = XOpenDisplay(0))) 154 { 155 XAutoRepeatOn(display); 156 XCloseDisplay(display); 157 } 122 158 } 123 159
Note: See TracChangeset
for help on using the changeset viewer.