Browse Source

Handle X.org patch level features

With the 1.20.x releases there has been features and API changes even on
patch level versions, so we need to update our macros to handle these as
well.
tags/v1.11.90
Pierre Ossman 2 years ago
parent
commit
0480267070

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

@@ -269,7 +269,7 @@ static inline void pressKey(DeviceIntPtr dev, int kc, Bool down, const char *msg
LOG_DEBUG("%s %d %s", msg, kc, down ? "down" : "up");

action = down ? KeyPress : KeyRelease;
#if XORG < 118
#if XORG_OLDER_THAN(1, 18, 0)
QueueKeyboardEvents(dev, action, kc, NULL);
#else
QueueKeyboardEvents(dev, action, kc);

+ 1
- 1
unix/xserver/hw/vnc/InputXKB.c View File

@@ -42,7 +42,7 @@
#define KEYBOARD_OR_FLOAT MASTER_KEYBOARD
#endif

#if XORG < 118
#if XORG_OLDER_THAN(1, 18, 0)
#define GetMaster(dev, type) ((dev)->master)
#endif


+ 11
- 11
unix/xserver/hw/vnc/vncBlockHandler.c View File

@@ -33,7 +33,7 @@
#include "vncBlockHandler.h"
#include "xorg-version.h"

#if XORG >= 119
#if XORG_AT_LEAST(1, 19, 0)
static void vncBlockHandler(void* data, void* timeout);
static void vncSocketNotify(int fd, int xevents, void *data);
#else
@@ -53,7 +53,7 @@ static struct vncFdEntry* fdsHead = NULL;
void vncRegisterBlockHandlers(void)
{
if (!RegisterBlockAndWakeupHandlers(vncBlockHandler,
#if XORG >= 119
#if XORG_AT_LEAST(1, 19, 0)
(ServerWakeupHandlerProcPtr)NoopDDA,
#else
vncWakeupHandler,
@@ -64,7 +64,7 @@ void vncRegisterBlockHandlers(void)

void vncSetNotifyFd(int fd, int scrIdx, int read, int write)
{
#if XORG >= 119
#if XORG_AT_LEAST(1, 19, 0)
int mask = (read ? X_NOTIFY_READ : 0) | (write ? X_NOTIFY_WRITE : 0);
SetNotifyFd(fd, vncSocketNotify, mask, (void*)(intptr_t)scrIdx);
#else
@@ -96,7 +96,7 @@ void vncSetNotifyFd(int fd, int scrIdx, int read, int write)

void vncRemoveNotifyFd(int fd)
{
#if XORG >= 119
#if XORG_AT_LEAST(1, 19, 0)
RemoveNotifyFd(fd);
#else
struct vncFdEntry** prev;
@@ -117,7 +117,7 @@ void vncRemoveNotifyFd(int fd)
#endif
}

#if XORG >= 119
#if XORG_AT_LEAST(1, 19, 0)
static void vncSocketNotify(int fd, int xevents, void *data)
{
int scrIdx;
@@ -129,7 +129,7 @@ static void vncSocketNotify(int fd, int xevents, void *data)
}
#endif

#if XORG < 119
#if XORG_OLDER_THAN(1, 19, 0)
static void vncWriteBlockHandlerFallback(OSTimePtr timeout);
static void vncWriteWakeupHandlerFallback(void);
void vncWriteBlockHandler(fd_set *fds);
@@ -143,13 +143,13 @@ void vncWriteWakeupHandler(int nfds, fd_set *fds);
// descriptors that we want read events on.
//

#if XORG >= 119
#if XORG_AT_LEAST(1, 19, 0)
static void vncBlockHandler(void* data, void* timeout)
#else
static void vncBlockHandler(void * data, OSTimePtr t, void * readmask)
#endif
{
#if XORG < 119
#if XORG_OLDER_THAN(1, 19, 0)
int _timeout;
int* timeout = &_timeout;
static struct timeval tv;
@@ -165,7 +165,7 @@ static void vncBlockHandler(void * data, OSTimePtr t, void * readmask)

vncCallBlockHandlers(timeout);

#if XORG < 119
#if XORG_OLDER_THAN(1, 19, 0)
if (_timeout != -1) {
tv.tv_sec= _timeout / 1000;
tv.tv_usec = (_timeout % 1000) * 1000;
@@ -184,7 +184,7 @@ static void vncBlockHandler(void * data, OSTimePtr t, void * readmask)
#endif
}

#if XORG < 119
#if XORG_OLDER_THAN(1, 19, 0)
static void vncWakeupHandler(void * data, int nfds, void * readmask)
{
fd_set* fds = (fd_set*)readmask;
@@ -211,7 +211,7 @@ static void vncWakeupHandler(void * data, int nfds, void * readmask)
// modified Xorg and might therefore not be called.
//

#if XORG < 119
#if XORG_OLDER_THAN(1, 19, 0)
static Bool needFallback = TRUE;
static fd_set fallbackFds;
static struct timeval tw;

+ 13
- 13
unix/xserver/hw/vnc/vncHooks.c View File

@@ -60,7 +60,7 @@ typedef struct _vncHooksScreenRec {
CopyWindowProcPtr CopyWindow;
ClearToBackgroundProcPtr ClearToBackground;
DisplayCursorProcPtr DisplayCursor;
#if XORG >= 119
#if XORG_AT_LEAST(1, 19, 0)
CursorWarpedToProcPtr CursorWarpedTo;
#endif
ScreenBlockHandlerProcPtr BlockHandler;
@@ -112,17 +112,17 @@ static void vncHooksClearToBackground(WindowPtr pWin, int x, int y, int w,
int h, Bool generateExposures);
static Bool vncHooksDisplayCursor(DeviceIntPtr pDev,
ScreenPtr pScreen, CursorPtr cursor);
#if XORG >= 119
#if XORG_AT_LEAST(1, 19, 0)
static void vncHooksCursorWarpedTo(DeviceIntPtr pDev,
ScreenPtr pScreen_, ClientPtr pClient,
WindowPtr pWindow, SpritePtr pSprite,
int x, int y);
#endif
#if XORG <= 118
#if XORG_AT_LEAST(1, 19, 0)
static void vncHooksBlockHandler(ScreenPtr pScreen, void * pTimeout);
#else
static void vncHooksBlockHandler(ScreenPtr pScreen, void * pTimeout,
void * pReadmask);
#else
static void vncHooksBlockHandler(ScreenPtr pScreen, void * pTimeout);
#endif
static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask,
@@ -272,7 +272,7 @@ int vncHooksInit(int scrIdx)
wrap(vncHooksScreen, pScreen, CopyWindow, vncHooksCopyWindow);
wrap(vncHooksScreen, pScreen, ClearToBackground, vncHooksClearToBackground);
wrap(vncHooksScreen, pScreen, DisplayCursor, vncHooksDisplayCursor);
#if XORG >= 119
#if XORG_AT_LEAST(1, 19, 0)
wrap(vncHooksScreen, pScreen, CursorWarpedTo, vncHooksCursorWarpedTo);
#endif
wrap(vncHooksScreen, pScreen, BlockHandler, vncHooksBlockHandler);
@@ -631,7 +631,7 @@ out:

// CursorWarpedTo - notify that the cursor was warped

#if XORG >= 119
#if XORG_AT_LEAST(1, 19, 0)
static void vncHooksCursorWarpedTo(DeviceIntPtr pDev,
ScreenPtr pScreen_, ClientPtr pClient,
WindowPtr pWindow, SpritePtr pSprite,
@@ -646,21 +646,21 @@ static void vncHooksCursorWarpedTo(DeviceIntPtr pDev,
// BlockHandler - ignore any changes during the block handler - it's likely
// these are just drawing the cursor.

#if XORG <= 118
#if XORG_AT_LEAST(1, 19, 0)
static void vncHooksBlockHandler(ScreenPtr pScreen_, void * pTimeout)
#else
static void vncHooksBlockHandler(ScreenPtr pScreen_, void * pTimeout,
void * pReadmask)
#else
static void vncHooksBlockHandler(ScreenPtr pScreen_, void * pTimeout)
#endif
{
SCREEN_PROLOGUE(pScreen_, BlockHandler);

vncHooksScreen->ignoreHooks++;

#if XORG <= 118
(*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
#else
#if XORG_AT_LEAST(1, 19, 0)
(*pScreen->BlockHandler) (pScreen, pTimeout);
#else
(*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
#endif

vncHooksScreen->ignoreHooks--;

+ 9
- 12
unix/xserver/hw/vnc/xorg-version.h View File

@@ -24,19 +24,16 @@
#include <dix-config.h>
#endif

#if XORG_VERSION_CURRENT < ((1 * 10000000) + (15 * 100000) + (99 * 1000))
#define XORG_AT_LEAST(major, minor, patch) \
(XORG_VERSION_CURRENT >= ((major * 10000000) + (minor * 100000) + (patch * 1000)))
#define XORG_OLDER_THAN(major, minor, patch) \
(XORG_VERSION_CURRENT < ((major * 10000000) + (minor * 100000) + (patch * 1000)))

#if XORG_OLDER_THAN(1, 16, 0)
#error "X.Org older than 1.16 is not supported"
#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (16 * 100000) + (99 * 1000))
#define XORG 116
#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (17 * 100000) + (99 * 1000))
#define XORG 117
#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (18 * 100000) + (99 * 1000))
#define XORG 118
#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (19 * 100000) + (99 * 1000))
#define XORG 119
#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (20 * 100000) + (99 * 1000))
#define XORG 120
#else
#endif

#if XORG_AT_LEAST(1, 21, 0)
#error "X.Org newer than 1.20 is not supported"
#endif


+ 6
- 2
unix/xserver/hw/vnc/xvnc.c View File

@@ -184,7 +184,7 @@ vfbBitsPerPixel(int depth)
static void vfbFreeFramebufferMemory(vfbFramebufferInfoPtr pfb);

#ifdef DPMSExtension
#if XORG < 120
#if XORG_OLDER_THAN(1, 20, 0)
/* Why support DPMS? Because stupid modern desktop environments
such as Unity 2D on Ubuntu 11.10 crashes if DPMS is not
available. (DPMSSet is called by dpms.c, but the return value
@@ -262,6 +262,7 @@ ddxBeforeReset(void)
#endif

#if INPUTTHREAD
#if XORG_AT_LEAST(1, 20, 7)
/** This function is called in Xserver/os/inputthread.c when starting
the input thread. */
void
@@ -269,6 +270,7 @@ ddxInputThreadInit(void)
{
}
#endif
#endif

void
ddxUseMsg(void)
@@ -1380,6 +1382,7 @@ vfbClientStateChange(CallbackListPtr *a, void *b, void *c)
}

#ifdef GLXEXT
#if XORG_OLDER_THAN(1, 20, 0)
extern void GlxExtensionInit(void);

static ExtensionModule glxExt = {
@@ -1388,6 +1391,7 @@ static ExtensionModule glxExt = {
&noGlxExtension
};
#endif
#endif

void
InitOutput(ScreenInfo * scrInfo, int argc, char **argv)
@@ -1397,7 +1401,7 @@ InitOutput(ScreenInfo * scrInfo, int argc, char **argv)

vncPrintBanner();

#if XORG >= 120
#if XORG_AT_LEAST(1, 20, 0)
xorgGlxCreateVendor();
#else


Loading…
Cancel
Save