summaryrefslogtreecommitdiff
path: root/randr/rrproperty.c
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-05-15 12:31:34 -0700
committerJamey Sharp <jamey@minilop.net>2010-05-19 12:32:34 -0700
commit4b9600a4167427a8fe88bca9b738c9a99cac9469 (patch)
treea22ef3ebd07d5561041ae1a2483f279eaeaa0e6b /randr/rrproperty.c
parentee9cd2df4a5af66c6b7073563785b8aef61fcdb8 (diff)
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>
Diffstat (limited to 'randr/rrproperty.c')
-rw-r--r--randr/rrproperty.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index ff0bca014..3aab37afd 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -29,7 +29,6 @@ DeliverPropertyEvent(WindowPtr pWin, void *value)
{
xRROutputPropertyNotifyEvent *event = value;
RREventPtr *pHead, pRREvent;
- ClientPtr client;
dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
RREventType, serverClient, DixReadAccess);
@@ -38,14 +37,10 @@ DeliverPropertyEvent(WindowPtr pWin, void *value)
for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next)
{
- client = pRREvent->client;
- if (client == serverClient || client->clientGone)
- continue;
-
if (!(pRREvent->mask & RROutputPropertyNotifyMask))
continue;
- event->sequenceNumber = client->sequence;
+ event->sequenceNumber = pRREvent->client->sequence;
event->window = pRREvent->window->drawable.id;
WriteEventsToClient(pRREvent->client, 1, (xEvent *)event);
}