]> source.dussan.org Git - tigervnc.git/commitdiff
[Development] Add support for X.Org 1.10
authorAdam Tkac <atkac@redhat.com>
Wed, 8 Dec 2010 16:05:48 +0000 (16:05 +0000)
committerAdam Tkac <atkac@redhat.com>
Wed, 8 Dec 2010 16:05:48 +0000 (16:05 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4221 3789f03b-4d11-0410-bbf8-ca57d06f2519

unix/xserver/hw/vnc/Input.cc
unix/xserver/hw/vnc/vncHooks.cc
unix/xserver/hw/vnc/xorg-version.h
unix/xserver/hw/vnc/xvnc.cc

index 14d195b2efeeae0df80d40f3a3c111b76141a43f..9eb70f8132643a46e36e586e3d9b8d85324e5d14 100644 (file)
@@ -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<<i)) ?
                                     ButtonPress : ButtonRelease;
+#if XORG < 110
                        n = GetPointerEvents(eventq, pointerDev, action, i + 1,
                                             POINTER_RELATIVE, 0, 0, NULL);
+#else
+                       valuator_mask_set_range(&mask, 0, 0, NULL);
+                       n = GetPointerEvents(eventq, pointerDev, action, i + 1,
+                                            POINTER_RELATIVE, &mask);
+#endif
                        enqueueEvents(pointerDev, n);
 
                }
@@ -160,6 +172,9 @@ void InputDevice::PointerButtonAction(int buttonMask)
 void InputDevice::PointerMove(const rfb::Point &pos)
 {
        int n, valuators[2];
+#if XORG >= 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;
index 1f928505375057a459f1530be80607e081f0c05d..3531ef26e202ff17dc5d7ba764adacd6807aeeb7 100644 (file)
@@ -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
 
index 1cffa89e3f0fbb738a9e968cbd79f89d0367c398..9493e5beb2acfd3a83dfd632bf738e65775d5e4b 100644 (file)
 #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
index 5e63b34fc1ebb903f953ab7f5b22dfd107c8cf61..067ce96b6de0c3181be440dee742411fd4784ed1 100644 (file)
@@ -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