From 9ea88717db376b54b2c821ab67e846918acc616a Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sun, 3 Jul 2016 22:06:43 +0200 Subject: Make WriteEventsToClient/WriteToClient no-op on fake or dead clients. This matches the test in TryClientEvents, and is a superset of tests done by the callers of these functions. The consequence of forgetting these tests is a server crash, so they're always desirable. In my opinion, it's better to not require the callers to remember to do these checks. For callers that don't do very much work before calling WriteToClient or WriteEventsToClient, I've removed the redundant checks. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=27497 Signed-off-by: Jamey Sharp Cc: Chris Wilson Reviewed-by: Julien Cristau Reviewed-by: Adam Jackson Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/xfixes/cursor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver/xfixes/cursor.c') diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index 29c6061d6..747471e18 100755 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -96,8 +96,7 @@ CursorDisplayCursor (ScreenPtr pScreen, CursorCurrent = pCursor; for (e = cursorEvents; e; e = e->next) { - if ((e->eventMask & XFixesDisplayCursorNotifyMask) && - !e->pClient->clientGone) + if ((e->eventMask & XFixesDisplayCursorNotifyMask)) { xXFixesCursorNotifyEvent ev; ev.type = XFixesEventBase + XFixesCursorNotify; -- cgit v1.2.3 From cb0089bad114e79d5c6e4577da59fa8911d0ee8d Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sun, 3 Jul 2016 22:52:13 +0200 Subject: Set event sequence number in WriteEventsToClient instead of at callers. TryClientEvents already did this; this commit just moves the assignment one level down so that no event source has to worry about sequence numbers. ...No event source, that is, except XKB, which inexplicably calls WriteToClient directly for several events. Signed-off-by: Jamey Sharp Reviewed-by: Julien Cristau Reviewed-by: Adam Jackson Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/xfixes/cursor.c | 1 - 1 file changed, 1 deletion(-) (limited to 'nx-X11/programs/Xserver/xfixes/cursor.c') diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index 747471e18..c053a5aa3 100755 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -101,7 +101,6 @@ CursorDisplayCursor (ScreenPtr pScreen, xXFixesCursorNotifyEvent ev; ev.type = XFixesEventBase + XFixesCursorNotify; ev.subtype = XFixesDisplayCursorNotify; - ev.sequenceNumber = e->pClient->sequence; ev.window = e->pWindow->drawable.id; ev.cursorSerial = pCursor->serialNumber; ev.timestamp = currentTime.milliseconds; -- cgit v1.2.3