xserver: Branch 'master' - 2 commits
Adam Jackson
ajax at kemper.freedesktop.org
Fri Dec 8 16:56:43 UTC 2017
test/bigreq/meson.build | 6 ++++--
xfixes/cursor.c | 28 +++++++++++++++++++++-------
2 files changed, 25 insertions(+), 9 deletions(-)
New commits:
commit aa6651f83c698e8cc40de61aad36c73ca7a6adcf
Author: Adam Jackson <ajax at redhat.com>
Date: Thu Jun 8 16:23:12 2017 -0400
xfixes: Remove the CursorCurrent array
We're not wrapping all the ways a cursor can be destroyed, so this array
ends up with stale data. Rather than try harder to wrap more code paths,
just look up the cursor when we need it.
Signed-off-by: Adam Jackson <ajax at redhat.com>
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 09cf2fa69..cb38796c0 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -61,7 +61,6 @@
static RESTYPE CursorClientType;
static RESTYPE CursorHideCountType;
static RESTYPE CursorWindowType;
-static CursorPtr CursorCurrent[MAXDEVICES];
static DevPrivateKeyRec CursorScreenPrivateKeyRec;
@@ -132,10 +131,26 @@ typedef struct _CursorScreen {
Bool CursorVisible = FALSE;
Bool EnableCursor = TRUE;
+static CursorPtr
+CursorForDevice(DeviceIntPtr pDev)
+{
+ if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite)
+ return pDev->spriteInfo->sprite->current;
+
+ return NULL;
+}
+
+static CursorPtr
+CursorForClient(ClientPtr client)
+{
+ return CursorForDevice(PickPointer(client));
+}
+
static Bool
CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
CursorScreenPtr cs = GetCursorScreen(pScreen);
+ CursorPtr pOldCursor = CursorForDevice(pDev);
Bool ret;
DisplayCursorProcPtr backupProc;
@@ -150,11 +165,10 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
}
- if (pCursor != CursorCurrent[pDev->id]) {
+ if (pCursor != pOldCursor) {
CursorEventPtr e;
UpdateCurrentTimeIf();
- CursorCurrent[pDev->id] = pCursor;
for (e = cursorEvents; e; e = e->next) {
if ((e->eventMask & XFixesDisplayCursorNotifyMask)) {
xXFixesCursorNotifyEvent ev = {
@@ -351,7 +365,7 @@ ProcXFixesGetCursorImage(ClientPtr client)
int npixels, width, height, rc, x, y;
REQUEST_SIZE_MATCH(xXFixesGetCursorImageReq);
- pCursor = CursorCurrent[PickPointer(client)->id];
+ pCursor = CursorForClient(client);
if (!pCursor)
return BadCursor;
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR,
@@ -500,7 +514,7 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
int rc, x, y;
REQUEST_SIZE_MATCH(xXFixesGetCursorImageAndNameReq);
- pCursor = CursorCurrent[PickPointer(client)->id];
+ pCursor = CursorForClient(client);
if (!pCursor)
return BadCursor;
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR,
@@ -872,7 +886,7 @@ ProcXFixesHideCursor(ClientPtr client)
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (IsMaster(dev) && IsPointerDevice(dev))
CursorDisplayCursor(dev, pWin->drawable.pScreen,
- CursorCurrent[dev->id]);
+ CursorForDevice(dev));
}
}
@@ -967,7 +981,7 @@ CursorFreeHideCount(void *data, XID id)
deleteCursorHideCount(pChc, pChc->pScreen);
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (IsMaster(dev) && IsPointerDevice(dev))
- CursorDisplayCursor(dev, pScreen, CursorCurrent[dev->id]);
+ CursorDisplayCursor(dev, pScreen, CursorForDevice(dev));
}
return 1;
commit 3db7707df3cfd8ba62c10d08c7c731ec18ea8ddf
Author: Adam Jackson <ajax at redhat.com>
Date: Wed Dec 6 15:12:20 2017 -0500
test: Fix build dependency for bigreq test
libxcb-xinput isn't a thing in whichever Ubuntu it is that Travis is
using. The test is already optional, make it more so.
Signed-off-by: Adam Jackson <ajax at redhat.com>
diff --git a/test/bigreq/meson.build b/test/bigreq/meson.build
index 9462ede31..c544703e2 100644
--- a/test/bigreq/meson.build
+++ b/test/bigreq/meson.build
@@ -1,8 +1,10 @@
xcb_dep = dependency('xcb', required: false)
+xcb_xinput_dep = dependency('xcb-xinput', required: false)
if get_option('xvfb')
- if xcb_dep.found()
- requestlength = executable('request-length', 'request-length.c', dependencies: xcb_dep)
+ if xcb_dep.found() and xcb_xinput_dep.found()
+ requestlength = executable('request-length', 'request-length.c',
+ dependencies: [xcb_dep, xcb_xinput_dep])
test('request-length', simple_xinit, args: [requestlength, '--', xvfb_server])
endif
endif
More information about the xorg-commit
mailing list