From e7fae9ecc42ab5e73b89117722dbf4117d928f9a Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sat, 22 May 2010 00:26:28 -0700 Subject: Move each screen's root-window pointer into ScreenRec. Many references to the WindowTable array already had the corresponding screen pointer handy, which meant they usually looked like "WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of keeping this information in a parallel array simplifies those expressions, and eliminates a MAXSCREENS-sized array. Since dix uses this data, a screen private entry isn't appropriate. xf86-video-dummy currently uses WindowTable, so it needs to be updated to reflect this change. Signed-off-by: Jamey Sharp Reviewed-by: Tiago Vignatti Tested-by: Tiago Vignatti (i686 GNU/Linux) --- randr/rrscreen.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'randr/rrscreen.c') diff --git a/randr/rrscreen.c b/randr/rrscreen.c index a940f8aae..a2a0f36a6 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -73,7 +73,7 @@ RREditConnectionInfo (ScreenPtr pScreen) void RRSendConfigNotify (ScreenPtr pScreen) { - WindowPtr pWin = WindowTable[pScreen->myNum]; + WindowPtr pWin = pScreen->root; xEvent event; event.u.u.type = ConfigureNotify; @@ -97,7 +97,7 @@ RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen) rrScrPriv (pScreen); xRRScreenChangeNotifyEvent se; RRCrtcPtr crtc = pScrPriv->numCrtcs ? pScrPriv->crtcs[0] : NULL; - WindowPtr pRoot = WindowTable[pScreen->myNum]; + WindowPtr pRoot = pScreen->root; se.type = RRScreenChangeNotify + RREventBase; se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0); @@ -620,7 +620,7 @@ ProcRRGetScreenInfo (ClientPtr client) rep.setOfRotations = RR_Rotate_0; rep.sequenceNumber = client->sequence; rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; + rep.root = pWin->drawable.pScreen->root->drawable.id; rep.timestamp = currentTime.milliseconds; rep.configTimestamp = currentTime.milliseconds; rep.nSizes = 0; @@ -649,7 +649,7 @@ ProcRRGetScreenInfo (ClientPtr client) rep.setOfRotations = output->crtc->rotations; rep.sequenceNumber = client->sequence; rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; + rep.root = pWin->drawable.pScreen->root->drawable.id; rep.timestamp = pScrPriv->lastSetTime.milliseconds; rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; rep.rotation = output->crtc->rotation; @@ -961,7 +961,7 @@ sendReply: rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; + rep.root = pDraw->pScreen->root->drawable.id; if (client->swapped) { -- cgit v1.2.3