From: Adam Tkac Date: Wed, 8 Dec 2010 16:05:48 +0000 (+0000) Subject: [Development] Add support for X.Org 1.10 X-Git-Tag: v1.0.90~97 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=abe183ee1fa2a979ff4003e8a83e7358156bf83f;p=tigervnc.git [Development] Add support for X.Org 1.10 git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4221 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/unix/xserver/hw/vnc/Input.cc b/unix/xserver/hw/vnc/Input.cc index 14d195b2..9eb70f81 100644 --- a/unix/xserver/hw/vnc/Input.cc +++ b/unix/xserver/hw/vnc/Input.cc @@ -30,6 +30,9 @@ extern "C" { #define public c_public #define class c_class #include "inputstr.h" +#if XORG >= 110 +#include "inpututils.h" +#endif #include "mi.h" #ifndef XKB_IN_SERVER #define XKB_IN_SERVER @@ -140,6 +143,9 @@ InputDevice::InputDevice(rfb::VNCServerST *_server) void InputDevice::PointerButtonAction(int buttonMask) { int i, n; +#if XORG >= 110 + ValuatorMask mask; +#endif initInputDevice(); @@ -147,8 +153,14 @@ void InputDevice::PointerButtonAction(int buttonMask) if ((buttonMask ^ oldButtonMask) & (1 << i)) { int action = (buttonMask & (1<= 110 + ValuatorMask mask; +#endif if (pos.equals(cursorPos)) return; @@ -168,8 +183,14 @@ void InputDevice::PointerMove(const rfb::Point &pos) valuators[0] = pos.x; valuators[1] = pos.y; +#if XORG < 110 n = GetPointerEvents(eventq, pointerDev, MotionNotify, 0, POINTER_ABSOLUTE, 0, 2, valuators); +#else + valuator_mask_set_range(&mask, 0, 2, valuators); + n = GetPointerEvents(eventq, pointerDev, MotionNotify, 0, POINTER_ABSOLUTE, + &mask); +#endif enqueueEvents(pointerDev, n); cursorPos = pos; diff --git a/unix/xserver/hw/vnc/vncHooks.cc b/unix/xserver/hw/vnc/vncHooks.cc index 1f928505..3531ef26 100644 --- a/unix/xserver/hw/vnc/vncHooks.cc +++ b/unix/xserver/hw/vnc/vncHooks.cc @@ -72,7 +72,9 @@ typedef struct { CreateGCProcPtr CreateGC; CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; +#if XORG < 110 RestoreAreasProcPtr RestoreAreas; +#endif InstallColormapProcPtr InstallColormap; StoreColorsProcPtr StoreColors; DisplayCursorProcPtr DisplayCursor; @@ -120,7 +122,9 @@ static void vncHooksCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion); static void vncHooksClearToBackground(WindowPtr pWin, int x, int y, int w, int h, Bool generateExposures); +#if XORG < 110 static RegionPtr vncHooksRestoreAreas(WindowPtr pWin, RegionPtr prgnExposed); +#endif static void vncHooksInstallColormap(ColormapPtr pColormap); static void vncHooksStoreColors(ColormapPtr pColormap, int ndef, xColorItem* pdef); @@ -260,7 +264,9 @@ Bool vncHooksInit(ScreenPtr pScreen, XserverDesktop* desktop) vncHooksScreen->CreateGC = pScreen->CreateGC; vncHooksScreen->CopyWindow = pScreen->CopyWindow; vncHooksScreen->ClearToBackground = pScreen->ClearToBackground; +#if XORG < 110 vncHooksScreen->RestoreAreas = pScreen->RestoreAreas; +#endif vncHooksScreen->InstallColormap = pScreen->InstallColormap; vncHooksScreen->StoreColors = pScreen->StoreColors; vncHooksScreen->DisplayCursor = pScreen->DisplayCursor; @@ -284,7 +290,9 @@ Bool vncHooksInit(ScreenPtr pScreen, XserverDesktop* desktop) pScreen->CreateGC = vncHooksCreateGC; pScreen->CopyWindow = vncHooksCopyWindow; pScreen->ClearToBackground = vncHooksClearToBackground; +#if XORG < 110 pScreen->RestoreAreas = vncHooksRestoreAreas; +#endif pScreen->InstallColormap = vncHooksInstallColormap; pScreen->StoreColors = vncHooksStoreColors; pScreen->DisplayCursor = vncHooksDisplayCursor; @@ -334,7 +342,9 @@ static Bool vncHooksCloseScreen(int i, ScreenPtr pScreen_) pScreen->CreateGC = vncHooksScreen->CreateGC; pScreen->CopyWindow = vncHooksScreen->CopyWindow; pScreen->ClearToBackground = vncHooksScreen->ClearToBackground; +#if XORG < 110 pScreen->RestoreAreas = vncHooksScreen->RestoreAreas; +#endif pScreen->InstallColormap = vncHooksScreen->InstallColormap; pScreen->StoreColors = vncHooksScreen->StoreColors; pScreen->DisplayCursor = vncHooksScreen->DisplayCursor; @@ -428,6 +438,7 @@ static void vncHooksClearToBackground(WindowPtr pWin, int x, int y, int w, SCREEN_REWRAP(ClearToBackground); } +#if XORG < 110 // RestoreAreas - changed region is the given region static RegionPtr vncHooksRestoreAreas(WindowPtr pWin, RegionPtr pRegion) @@ -444,6 +455,7 @@ static RegionPtr vncHooksRestoreAreas(WindowPtr pWin, RegionPtr pRegion) return result; } +#endif // InstallColormap - get the new colormap diff --git a/unix/xserver/hw/vnc/xorg-version.h b/unix/xserver/hw/vnc/xorg-version.h index 1cffa89e..9493e5be 100644 --- a/unix/xserver/hw/vnc/xorg-version.h +++ b/unix/xserver/hw/vnc/xorg-version.h @@ -34,8 +34,10 @@ #define XORG 18 #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (9 * 100000) + (99 * 1000)) #define XORG 19 +#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (10 * 100000) + (99 * 1000)) +#define XORG 110 #else -#error "X.Org newer than 1.9 is not supported" +#error "X.Org newer than 1.10 is not supported" #endif #endif diff --git a/unix/xserver/hw/vnc/xvnc.cc b/unix/xserver/hw/vnc/xvnc.cc index 5e63b34f..067ce96b 100644 --- a/unix/xserver/hw/vnc/xvnc.cc +++ b/unix/xserver/hw/vnc/xvnc.cc @@ -890,9 +890,11 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) WindowPtr pChild; Bool WasViewable = (Bool)(pWin->viewable); Bool anyMarked = FALSE; +#if XORG < 110 RegionPtr pOldClip = NULL, bsExposed; #ifdef DO_SAVE_UNDERS Bool dosave = FALSE; +#endif #endif WindowPtr pLayerWin; BoxRec box; @@ -951,11 +953,13 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) if (WasViewable) { +#if XORG < 110 if (pWin->backStorage) { pOldClip = REGION_CREATE(pScreen, NullBox, 1); REGION_COPY(pScreen, pOldClip, &pWin->clipList); } +#endif if (pWin->firstChild) { @@ -969,7 +973,7 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) anyMarked = TRUE; } -#ifdef DO_SAVE_UNDERS +#if XORG < 110 && defined(DO_SAVE_UNDERS) if (DO_SAVE_UNDERS(pWin)) { dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin); @@ -980,6 +984,7 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); } +#if XORG < 110 if (pWin->backStorage && ((pWin->backingStore == Always) || WasViewable)) { @@ -1002,11 +1007,13 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) REGION_DESTROY(pScreen, bsExposed); } } +#endif if (WasViewable) { if (anyMarked) (*pScreen->HandleExposures)(pWin); -#ifdef DO_SAVE_UNDERS + +#if XORG < 110 && defined(DO_SAVE_UNDERS) if (dosave) (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); #endif /* DO_SAVE_UNDERS */ @@ -1184,7 +1191,9 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) if (!ret) return FALSE; +#if XORG < 110 miInitializeBackingStore(pScreen); +#endif /* * Circumvent the backing store that was just initialised. This amounts