Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 14, 2008, 11:44:17 AM (16 years ago)
Author:
rgrieder
Message:

merged input branch into merge branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/merge/src/core/SignalHandler.cc

    r1062 r1272  
    3535
    3636#include <assert.h>
     37#include <iostream>
    3738
    3839#include "Debug.h"
     
    4344
    4445#include <wait.h>
     46#include <X11/Xlib.h>
     47#include <X11/Xutil.h>
     48#include <X11/keysym.h>
     49
     50bool SignalHandler::bXAutoKeyRepeatOn_ = false;
    4551
    4652SignalHandler::SignalHandler()
     
    5864  this->fileName = fileName;
    5965
     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
    6085  // make sure doCatch is only called once without calling dontCatch
    6186  assert( sigRecList.size() == 0 );
     
    120145      sigName = "SIGILL";
    121146      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    }
    122158  }
    123159
Note: See TracChangeset for help on using the changeset viewer.