diff options
author | Pierre Ossman <ossman@cendio.se> | 2014-07-14 13:41:36 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2014-07-14 13:41:36 +0200 |
commit | de0b3532320e088440bd7607f7d5d7e8fc720d94 (patch) | |
tree | b8e9ff8acc2b0d81e1ef55d4255a6abfe8792655 /unix/xserver/hw/vnc/XserverDesktop.cc | |
parent | 8c8f85034b15d7d2a1589378f9d0ee236a98a3c8 (diff) | |
download | tigervnc-de0b3532320e088440bd7607f7d5d7e8fc720d94.tar.gz tigervnc-de0b3532320e088440bd7607f7d5d7e8fc720d94.zip |
Make InputDevice into a singleton
Xorg input devices are global so it doesn't make sense that we
have one InputDevice object per XserverDesktop.
Diffstat (limited to 'unix/xserver/hw/vnc/XserverDesktop.cc')
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.cc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index cd76d068..8f426cce 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -158,15 +158,12 @@ XserverDesktop::XserverDesktop(ScreenPtr pScreen_, if (httpListener) httpServer = new FileHTTPServer(this); - - inputDevice = new InputDevice(server); } XserverDesktop::~XserverDesktop() { if (!directFbptr) delete [] data; - delete inputDevice; delete httpServer; delete server; } @@ -581,7 +578,7 @@ void XserverDesktop::blockHandler(fd_set* fds, OSTimePtr timeout) // so we abuse the fact that this routine will be called first thing // once the dix is done initialising. // [1] Technically Xvnc has InitInput(), but libvnc.so has nothing. - inputDevice->InitInputDevice(); + vncInputDevice->InitInputDevice(); try { int nextTimeout; @@ -690,8 +687,8 @@ void XserverDesktop::wakeupHandler(fd_set* fds, int nfds) } // We are responsible for propagating mouse movement between clients - if (!oldCursorPos.equals(inputDevice->getPointerPos())) { - oldCursorPos = inputDevice->getPointerPos(); + if (!oldCursorPos.equals(vncInputDevice->getPointerPos())) { + oldCursorPos = vncInputDevice->getPointerPos(); server->setCursorPos(oldCursorPos); } } @@ -820,8 +817,8 @@ void XserverDesktop::approveConnection(void* opaqueId, bool accept, void XserverDesktop::pointerEvent(const Point& pos, int buttonMask) { - inputDevice->PointerMove(pos); - inputDevice->PointerButtonAction(buttonMask); + vncInputDevice->PointerMove(pos); + vncInputDevice->PointerButtonAction(buttonMask); } void XserverDesktop::clientCutText(const char* str, int len) @@ -1138,7 +1135,7 @@ void XserverDesktop::lookup(int index, int* r, int* g, int* b) void XserverDesktop::keyEvent(rdr::U32 keysym, bool down) { if (down) - inputDevice->KeyboardPress(keysym); + vncInputDevice->KeyboardPress(keysym); else - inputDevice->KeyboardRelease(keysym); + vncInputDevice->KeyboardRelease(keysym); } |