summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-10-06 12:21:20 -0400
committerAdam Jackson <ajax@redhat.com>2008-11-05 13:01:03 -0500
commit42429aa3269d68bc7909616ce8b0d0b5ca5624d2 (patch)
tree59f06eed583493d8152ab11193904eea199547b8
parentb28c25b5aeecea22aba997e2b0d24e77a22b6e02 (diff)
RANDR: Delivery output property events.
(cherry picked from commit 9187f6ad9ec7ba9569a93d92561aac17eaa83491)
-rw-r--r--randr/rrproperty.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index 429246c68..446b4cc4a 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -24,10 +24,36 @@
#include "propertyst.h"
#include "swaprep.h"
-static void
-RRDeliverEvent (ScreenPtr pScreen, xEvent *event, CARD32 mask)
+static int
+DeliverPropertyEvent(WindowPtr pWin, void *value)
{
+ xRROutputPropertyNotifyEvent *event = value;
+ RREventPtr *pHead, pRREvent;
+ ClientPtr client;
+
+ pHead = LookupIDByType(pWin->drawable.id, RREventType);
+ if (!pHead)
+ return WT_WALKCHILDREN;
+
+ for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next)
+ {
+ client = pRREvent->client;
+ if (client == serverClient || client->clientGone)
+ continue;
+
+ if (!(pRREvent->mask & RROutputPropertyNotifyMask))
+ continue;
+
+ event->window = pRREvent->window->drawable.id;
+ WriteEventsToClient(pRREvent->client, 1, (xEvent *)event);
+ }
+ return WT_WALKCHILDREN;
+}
+
+static void RRDeliverPropertyEvent(ScreenPtr pScreen, xEvent *event)
+{
+ WalkTree(pScreen, DeliverPropertyEvent, event);
}
void
@@ -45,7 +71,7 @@ RRDeleteAllOutputProperties (RROutputPtr output)
event.state = PropertyDelete;
event.atom = prop->propertyName;
event.timestamp = currentTime.milliseconds;
- RRDeliverEvent (output->pScreen, (xEvent *) &event, RROutputPropertyNotifyMask);
+ RRDeliverPropertyEvent (output->pScreen, (xEvent *)&event);
if (prop->current.data)
xfree(prop->current.data);
if (prop->pending.data)
@@ -113,7 +139,7 @@ RRDeleteOutputProperty (RROutputPtr output, Atom property)
event.state = PropertyDelete;
event.atom = prop->propertyName;
event.timestamp = currentTime.milliseconds;
- RRDeliverEvent (output->pScreen, (xEvent *) &event, RROutputPropertyNotifyMask);
+ RRDeliverPropertyEvent (output->pScreen, (xEvent *)&event);
RRDestroyOutputProperty (prop);
}
}
@@ -238,7 +264,7 @@ RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type,
event.state = PropertyNewValue;
event.atom = prop->propertyName;
event.timestamp = currentTime.milliseconds;
- RRDeliverEvent (output->pScreen, (xEvent *) &event, RROutputPropertyNotifyMask);
+ RRDeliverPropertyEvent (output->pScreen, (xEvent *)&event);
}
return(Success);
}
@@ -700,7 +726,7 @@ ProcRRGetOutputProperty (ClientPtr client)
event.state = PropertyDelete;
event.atom = prop->propertyName;
event.timestamp = currentTime.milliseconds;
- RRDeliverEvent (output->pScreen, (xEvent *) &event, RROutputPropertyNotifyMask);
+ RRDeliverPropertyEvent (output->pScreen, (xEvent *)&event);
}
if (client->swapped) {