]> source.dussan.org Git - tigervnc.git/commitdiff
Handle closing of input devices 6/head
authorPierre Ossman <ossman@cendio.se>
Mon, 14 Jul 2014 11:46:48 +0000 (13:46 +0200)
committerPierre Ossman <ossman@cendio.se>
Mon, 14 Jul 2014 11:46:48 +0000 (13:46 +0200)
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.

unix/xserver/hw/vnc/Input.cc
unix/xserver/hw/vnc/Input.h

index 1d8757469c0afddd2213ae9737a92ef93fb39a86..28b84c71fd9f20e12c7b5bddbbe91634b55a7f17 100644 (file)
@@ -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
index 029b80d13bcbf90dec04165dae4de4e66bc28345..90b392cf001bcc6ab6e30b3e59b9ea719caa9137 100644 (file)
@@ -116,7 +116,6 @@ private:
 #endif
 
 private:
-       bool initialized;
        DeviceIntPtr keyboardDev;
        DeviceIntPtr pointerDev;