Browse Source

Make sure InputDevice::InitInputDevice() gets called early in

the startup process so our devices are visible and available
right away.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5069 3789f03b-4d11-0410-bbf8-ca57d06f2519
tags/v1.2.90
Pierre Ossman 11 years ago
parent
commit
cde21d8590
3 changed files with 12 additions and 10 deletions
  1. 1
    7
      unix/xserver/hw/vnc/Input.cc
  2. 5
    3
      unix/xserver/hw/vnc/Input.h
  3. 6
    0
      unix/xserver/hw/vnc/XserverDesktop.cc

+ 1
- 7
unix/xserver/hw/vnc/Input.cc View File

@@ -160,8 +160,6 @@ void InputDevice::PointerButtonAction(int buttonMask)
ValuatorMask mask;
#endif

initInputDevice();

for (i = 0; i < BUTTONS; i++) {
if ((buttonMask ^ oldButtonMask) & (1 << i)) {
int action = (buttonMask & (1<<i)) ?
@@ -199,8 +197,6 @@ void InputDevice::PointerMove(const rfb::Point &pos)
if (pos.equals(cursorPos))
return;

initInputDevice();

valuators[0] = pos.x;
valuators[1] = pos.y;
#if XORG < 110
@@ -287,7 +283,7 @@ static int pointerProc(DeviceIntPtr pDevice, int onoff)
return Success;
}

void InputDevice::initInputDevice(void)
void InputDevice::InitInputDevice(void)
{
#if XORG >= 17
int ret;
@@ -612,8 +608,6 @@ void InputDevice::keyEvent(rdr::U32 keysym, bool down)
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

+ 5
- 3
unix/xserver/hw/vnc/Input.h View File

@@ -55,17 +55,19 @@ public:

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;

+ 6
- 0
unix/xserver/hw/vnc/XserverDesktop.cc View File

@@ -576,6 +576,12 @@ static struct timeval XserverDesktopTimeout;

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;


Loading…
Cancel
Save