mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
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. hw/xquartz/xpr/appledri.c has an interesting case: While its check for "client == NULL" appears redundant with the test in WriteEventsToClient, it dereferences client to get the sequence number. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=27497 Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
@@ -78,8 +78,7 @@ XFixesSelectionCallback (CallbackListPtr *callbacks, pointer data, pointer args)
|
||||
for (e = selectionEvents; e; e = e->next)
|
||||
{
|
||||
if (e->selection == selection->selection &&
|
||||
(e->eventMask & eventMask) &&
|
||||
!e->pClient->clientGone)
|
||||
(e->eventMask & eventMask))
|
||||
{
|
||||
xXFixesSelectionNotifyEvent ev;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user