Revision: 5069 http://tigervnc.svn.sourceforge.net/tigervnc/?rev=5069&view=rev Author: ossman_ Date: 2013-04-09 14:59:31 +0000 (Tue, 09 Apr 2013) Log Message: ----------- Make sure InputDevice::InitInputDevice() gets called early in the startup process so our devices are visible and available right away.
Modified Paths: -------------- trunk/unix/xserver/hw/vnc/Input.cc trunk/unix/xserver/hw/vnc/Input.h trunk/unix/xserver/hw/vnc/XserverDesktop.cc Modified: trunk/unix/xserver/hw/vnc/Input.cc =================================================================== --- trunk/unix/xserver/hw/vnc/Input.cc 2013-04-09 14:54:17 UTC (rev 5068) +++ trunk/unix/xserver/hw/vnc/Input.cc 2013-04-09 14:59:31 UTC (rev 5069) @@ -160,8 +160,6 @@ ValuatorMask mask; #endif - initInputDevice(); - for (i = 0; i < BUTTONS; i++) { if ((buttonMask ^ oldButtonMask) & (1 << i)) { int action = (buttonMask & (1<<i)) ? @@ -199,8 +197,6 @@ if (pos.equals(cursorPos)) return; - initInputDevice(); - valuators[0] = pos.x; valuators[1] = pos.y; #if XORG < 110 @@ -287,7 +283,7 @@ return Success; } -void InputDevice::initInputDevice(void) +void InputDevice::InitInputDevice(void) { #if XORG >= 17 int ret; @@ -612,8 +608,6 @@ KeybdCtrl ctrl; #endif - initInputDevice(); - /* * Since we are checking the current state to determine if we need * to fake modifiers, we must make sure that everything put on the Modified: trunk/unix/xserver/hw/vnc/Input.h =================================================================== --- trunk/unix/xserver/hw/vnc/Input.h 2013-04-09 14:54:17 UTC (rev 5068) +++ trunk/unix/xserver/hw/vnc/Input.h 2013-04-09 14:59:31 UTC (rev 5069) @@ -55,17 +55,19 @@ void KeyboardPress(rdr::U32 keysym) { keyEvent(keysym, true); } void KeyboardRelease(rdr::U32 keysym) { keyEvent(keysym, false); } -private: + /* * Init input device. This cannot be done in the constructor * because constructor is called during X server extensions * initialization. Devices must be initialized after core * pointer/keyboard initialization which is actually after extesions * initialization. Check InitExtensions(), InitCoreDevices() and - * InitInput() calls in dix/main.c + * InitInput() calls in dix/main.c. Instead it is called from + * XserverDesktop at an appropriate time. */ - void initInputDevice(void); + void InitInputDevice(void); +private: void keyEvent(rdr::U32 keysym, bool down); rfb::VNCServerST *server; Modified: trunk/unix/xserver/hw/vnc/XserverDesktop.cc =================================================================== --- trunk/unix/xserver/hw/vnc/XserverDesktop.cc 2013-04-09 14:54:17 UTC (rev 5068) +++ trunk/unix/xserver/hw/vnc/XserverDesktop.cc 2013-04-09 14:59:31 UTC (rev 5069) @@ -576,6 +576,12 @@ void XserverDesktop::blockHandler(fd_set* fds, OSTimePtr timeout) { + // We don't have a good callback for when we can init input devices[1], + // 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(); + try { int nextTimeout; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ Tigervnc-commits mailing list Tigervnc-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tigervnc-commits