aboutsummaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2014-07-14 13:46:48 +0200
committerPierre Ossman <ossman@cendio.se>2014-07-14 13:46:48 +0200
commit5c6e64113d8ed7877d777fe6509c4566d48f2656 (patch)
treecc69728d92be1b727984cb2ae7f2928395aebb88 /unix
parentac38a07d36f18f722295e26ff03391657e08a89c (diff)
downloadtigervnc-5c6e64113d8ed7877d777fe6509c4566d48f2656.tar.gz
tigervnc-5c6e64113d8ed7877d777fe6509c4566d48f2656.zip
Handle closing of input devices
The core can decide to close an input device (e.g. during a server reset). Make sure we respect this by forgetting about the device and recreating it again later.
Diffstat (limited to 'unix')
-rw-r--r--unix/xserver/hw/vnc/Input.cc10
-rw-r--r--unix/xserver/hw/vnc/Input.h1
2 files changed, 5 insertions, 6 deletions
diff --git a/unix/xserver/hw/vnc/Input.cc b/unix/xserver/hw/vnc/Input.cc
index 1d875746..28b84c71 100644
--- a/unix/xserver/hw/vnc/Input.cc
+++ b/unix/xserver/hw/vnc/Input.cc
@@ -256,10 +256,9 @@ int InputDevice::pointerProc(DeviceIntPtr pDevice, int onoff)
case DEVICE_OFF:
pDev->on = FALSE;
break;
-#if 0
case DEVICE_CLOSE:
+ singleton.pointerDev = NULL;
break;
-#endif
}
return Success;
@@ -299,6 +298,9 @@ int InputDevice::keyboardProc(DeviceIntPtr pDevice, int onoff)
case DEVICE_OFF:
pDev->on = FALSE;
break;
+ case DEVICE_CLOSE:
+ singleton.keyboardDev = NULL;
+ break;
}
return Success;
@@ -306,11 +308,9 @@ int InputDevice::keyboardProc(DeviceIntPtr pDevice, int onoff)
void InputDevice::InitInputDevice(void)
{
- if (initialized)
+ if ((pointerDev != NULL) || (keyboardDev != NULL))
return;
- initialized = true;
-
#if XORG < 17
pointerDev = AddInputDevice(
#if XORG >= 16
diff --git a/unix/xserver/hw/vnc/Input.h b/unix/xserver/hw/vnc/Input.h
index 029b80d1..90b392cf 100644
--- a/unix/xserver/hw/vnc/Input.h
+++ b/unix/xserver/hw/vnc/Input.h
@@ -116,7 +116,6 @@ private:
#endif
private:
- bool initialized;
DeviceIntPtr keyboardDev;
DeviceIntPtr pointerDev;