aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/randr/randr.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/randr/randr.c')
-rw-r--r--xorg-server/randr/randr.c97
1 files changed, 97 insertions, 0 deletions
diff --git a/xorg-server/randr/randr.c b/xorg-server/randr/randr.c
index cb6fce7cd..87729e430 100644
--- a/xorg-server/randr/randr.c
+++ b/xorg-server/randr/randr.c
@@ -420,12 +420,41 @@ RRExtensionInit(void)
#endif
}
+void
+RRResourcesChanged(ScreenPtr pScreen)
+{
+ rrScrPriv(pScreen);
+ pScrPriv->resourcesChanged = TRUE;
+
+ RRSetChanged(pScreen);
+}
+
+static void
+RRDeliverResourceEvent(ClientPtr client, WindowPtr pWin)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ xRRResourceChangeNotifyEvent re;
+
+ rrScrPriv(pScreen);
+
+
+ re.type = RRNotify + RREventBase;
+ re.subCode = RRNotify_ResourceChange;
+ re.timestamp = pScrPriv->lastSetTime.milliseconds;
+ re.window = pWin->drawable.id;
+
+
+ WriteEventsToClient(client, 1, (xEvent *) &re);
+}
+
static int
TellChanged(WindowPtr pWin, pointer value)
{
RREventPtr *pHead, pRREvent;
ClientPtr client;
ScreenPtr pScreen = pWin->drawable.pScreen;
+ ScreenPtr iter;
+ rrScrPrivPtr pSlaveScrPriv;
rrScrPriv(pScreen);
int i;
@@ -450,6 +479,16 @@ TellChanged(WindowPtr pWin, pointer value)
if (crtc->changed)
RRDeliverCrtcEvent(client, pWin, crtc);
}
+
+ xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) {
+ pSlaveScrPriv = rrGetScrPriv(iter);
+ for (i = 0; i < pSlaveScrPriv->numCrtcs; i++) {
+ RRCrtcPtr crtc = pSlaveScrPriv->crtcs[i];
+
+ if (crtc->changed)
+ RRDeliverCrtcEvent(client, pWin, crtc);
+ }
+ }
}
if (pRREvent->mask & RROutputChangeNotifyMask) {
@@ -459,6 +498,40 @@ TellChanged(WindowPtr pWin, pointer value)
if (output->changed)
RRDeliverOutputEvent(client, pWin, output);
}
+
+ xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) {
+ pSlaveScrPriv = rrGetScrPriv(iter);
+ for (i = 0; i < pSlaveScrPriv->numOutputs; i++) {
+ RROutputPtr output = pSlaveScrPriv->outputs[i];
+
+ if (output->changed)
+ RRDeliverOutputEvent(client, pWin, output);
+ }
+ }
+ }
+
+ if (pRREvent->mask & RRProviderChangeNotifyMask) {
+ xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) {
+ pSlaveScrPriv = rrGetScrPriv(iter);
+ if (pSlaveScrPriv->provider->changed)
+ RRDeliverProviderEvent(client, pWin, pSlaveScrPriv->provider);
+ }
+ xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) {
+ pSlaveScrPriv = rrGetScrPriv(iter);
+ if (pSlaveScrPriv->provider->changed)
+ RRDeliverProviderEvent(client, pWin, pSlaveScrPriv->provider);
+ }
+ xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) {
+ pSlaveScrPriv = rrGetScrPriv(iter);
+ if (pSlaveScrPriv->provider->changed)
+ RRDeliverProviderEvent(client, pWin, pSlaveScrPriv->provider);
+ }
+ }
+
+ if (pRREvent->mask & RRResourceChangeNotifyMask) {
+ if (pScrPriv->resourcesChanged) {
+ RRDeliverResourceEvent(client, pWin);
+ }
}
}
return WT_WALKCHILDREN;
@@ -496,6 +569,8 @@ RRTellChanged(ScreenPtr pScreen)
rrScrPriv(pScreen);
rrScrPrivPtr mastersp;
int i;
+ ScreenPtr iter;
+ rrScrPrivPtr pSlaveScrPriv;
if (pScreen->isGPU) {
master = pScreen->current_master;
@@ -514,11 +589,33 @@ RRTellChanged(ScreenPtr pScreen)
}
pScrPriv->changed = FALSE;
mastersp->changed = FALSE;
+
WalkTree(master, TellChanged, (pointer) master);
+
+ mastersp->resourcesChanged = FALSE;
+
for (i = 0; i < pScrPriv->numOutputs; i++)
pScrPriv->outputs[i]->changed = FALSE;
for (i = 0; i < pScrPriv->numCrtcs; i++)
pScrPriv->crtcs[i]->changed = FALSE;
+
+ xorg_list_for_each_entry(iter, &master->output_slave_list, output_head) {
+ pSlaveScrPriv = rrGetScrPriv(iter);
+ pSlaveScrPriv->provider->changed = FALSE;
+ for (i = 0; i < pSlaveScrPriv->numOutputs; i++)
+ pSlaveScrPriv->outputs[i]->changed = FALSE;
+ for (i = 0; i < pSlaveScrPriv->numCrtcs; i++)
+ pSlaveScrPriv->crtcs[i]->changed = FALSE;
+ }
+ xorg_list_for_each_entry(iter, &master->offload_slave_list, offload_head) {
+ pSlaveScrPriv = rrGetScrPriv(iter);
+ pSlaveScrPriv->provider->changed = FALSE;
+ }
+ xorg_list_for_each_entry(iter, &master->unattached_list, unattached_head) {
+ pSlaveScrPriv = rrGetScrPriv(iter);
+ pSlaveScrPriv->provider->changed = FALSE;
+ }
+
if (mastersp->layoutChanged) {
pScrPriv->layoutChanged = FALSE;
RRPointerScreenConfigured(master);