diff options
author | Adam Tkac <atkac@redhat.com> | 2009-02-04 16:01:05 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2009-02-04 16:01:05 +0000 |
commit | 40bf4efd0553d152acb49653f44bd177133c4e92 (patch) | |
tree | 397325b7e68c099d20e362ec5a1f39a07ceb6d80 /unix | |
parent | 33c2212fe3f6ca444e09e85b3c151f234b787cf8 (diff) | |
download | tigervnc-40bf4efd0553d152acb49653f44bd177133c4e92.tar.gz tigervnc-40bf4efd0553d152acb49653f44bd177133c4e92.zip |
[Development] Make Xvnc working when compiled against X 1.6 branch.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3584 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix')
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.cc | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index 185344f0..db473922 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -62,14 +62,15 @@ extern char *display; #ifdef XKB #include <xkbsrv.h> #endif +#ifdef XORG_16 +#include "exevents.h" +extern void +CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master); +#endif #undef public #undef class } -#ifdef XORG_16 -#error "People, don't compile this code against 1.6 server, for now" -#endif - static DeviceIntPtr vncKeyboardDevice = NULL; static DeviceIntPtr vncPointerDevice = NULL; #ifdef XORG_15 @@ -1004,11 +1005,15 @@ altKeysym_t altKeysym[] = { * synchronized with vncKeyboardDevice. Do it via SwitchCoreKeyboard() * * 1.6 (aka MPX - Multi pointer X) - * - not working + * - multiple master devices (= core devices) exists, keep vncKeyboardDevice + * synchronized with proper master device */ void XserverDesktop::keyEvent(rdr::U32 keysym, bool down) { +#ifdef XORG_16 + DeviceIntPtr master; +#endif KeyClassPtr keyc = vncKeyboardDevice->key; KeySymsPtr keymap = &keyc->curKeySyms; unsigned int i, n; @@ -1071,20 +1076,20 @@ void XserverDesktop::keyEvent(rdr::U32 keysym, bool down) vlog.info("Added unknown keysym 0x%x to keycode %d",keysym,kc); - /* - * If vncKeyboardDevice is already core keyboard remove it and then add - * it. In theory, only copy of keysym map should be sufficient but, for - * now, this should be enough. - */ +#ifdef XORG_15 + master = inputInfo.keyboard; +#else + master = vncKeyboardDevice->u.master; +#endif if (vncKeyboardDevice == - dixLookupPrivate(&inputInfo.keyboard->devPrivates, - CoreDevicePrivateKey)) { - - dixSetPrivate(&inputInfo.keyboard->devPrivates, - CoreDevicePrivateKey, NULL); + dixLookupPrivate(&master->devPrivates, CoreDevicePrivateKey)) { + dixSetPrivate(&master->devPrivates, CoreDevicePrivateKey, NULL); +#ifdef XORG_15 SwitchCoreKeyboard(vncKeyboardDevice); +#else + CopyKeyClass(vncKeyboardDevice, master); +#endif } - break; } } |