]> source.dussan.org Git - tigervnc.git/commitdiff
We have an object to store stuff in, so don't use a global
authorPierre Ossman <ossman@cendio.se>
Tue, 9 Apr 2013 15:01:56 +0000 (15:01 +0000)
committerPierre Ossman <ossman@cendio.se>
Tue, 9 Apr 2013 15:01:56 +0000 (15:01 +0000)
variable.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5070 3789f03b-4d11-0410-bbf8-ca57d06f2519

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

index f2c8bee6e52f5a38a9dd97269091feca905bb9db..7a75c70327c6ebb008a8194b9fe33b9441fd6f90 100644 (file)
@@ -128,7 +128,7 @@ static void enqueueEvents(DeviceIntPtr dev, int n)
 #endif /* XORG < 111 */
 
 InputDevice::InputDevice(rfb::VNCServerST *_server)
-       : server(_server), oldButtonMask(0)
+       : server(_server), initialized(false), oldButtonMask(0)
 {
 #if XORG < 17
        pointerDev = AddInputDevice(
@@ -287,12 +287,11 @@ void InputDevice::InitInputDevice(void)
 {
 #if XORG >= 17
        int ret;
-       static int initialized = 0;
 
-       if (initialized != 0)
+       if (!initialized)
                return;
 
-       initialized = 1;
+       initialized = true;
 
        ret = AllocDevicePair(serverClient, "TigerVNC", &pointerDev,
                              &keyboardDev, pointerProc, keyboardProc,
index fb01bcede29b13cdb70cefe5cc9c79d7aa2c1fc4..fd458a60601744792e7f2428522948d331fc8400 100644 (file)
@@ -71,6 +71,7 @@ private:
        void keyEvent(rdr::U32 keysym, bool down);
 
        rfb::VNCServerST *server;
+       bool initialized;
        DeviceIntPtr keyboardDev;
        DeviceIntPtr pointerDev;
        int oldButtonMask;