From b0ffa7b286e0599c5a38a47a245054fc3a93f1ea Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 11 Sep 2025 16:50:43 +0200 Subject: [PATCH] treewide: rename dixGetFirstScreenPtr() to dixGetMasterScreen() for correct semantics In Xinerama/Panoramix configuration there's one screen that's having special meaning - it's used for simulating as the frontend for all client operations: the clients (should) only talk to that screen, while panoramix subsystem is proxying those operations to all the other screens (with certain changed applied, eg. coordinate transformations). Historically, this screen happens to be the first one in the system (some of it's proc's are hooked up in order to achieve desired behaviour). That's why it used to be accessed via screenInfo.screens[0] - that already had been encapsulated into a tiny helper `dixGetFirstScreen()`. a) the correct terminus technicus for a situation where one device (or SW entity) entirely controlling others is a master-slave-relationship: the controlling device/entity is `master`, the controlled ones are `slave` (to that specific master). b) the term "first screen" is inacurate and misleading here: what the caller's are actually interest in isn't the first entry in the screen array, but the screen that's controlling the others. With upcoming refactoring of the Xinerama/Panoramix subsystem, this might well be a different array index than 0. c) the term `default` also wouldn't match: `default` implies there's a real practical choice, and such value applies when no explicit choice has been made. But in this case, it practically doesn't make sense (except perhaps for debugging purpose) for a client to use any different screen. Therefore fixing the function name to the correct technical terminology. (for sake of patch readability, renaming corresponding variables is left to subsequent patches). Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/panoramiX.c | 10 +++++----- Xext/panoramiXprocs.c | 14 +++++++------- Xext/shm.c | 2 +- Xext/xvdisp.c | 2 +- Xi/xiquerypointer.c | 2 +- composite/compext.c | 4 ++-- dix/devices.c | 14 +++++++------- dix/dixfonts.c | 2 +- dix/events.c | 32 ++++++++++++++++---------------- dix/gestures.c | 2 +- dix/getevents.c | 2 +- dix/glyphcurs.c | 2 +- dix/screenint_priv.h | 2 +- dix/touch.c | 2 +- dix/window.c | 6 +++--- hw/xfree86/common/xf86Xinput.c | 4 ++-- hw/xquartz/darwin.c | 2 +- hw/xquartz/quartz.c | 2 +- hw/xquartz/quartzRandR.c | 4 ++-- hw/xwin/winkeybd.c | 2 +- hw/xwin/winmsgwindow.c | 2 +- mi/miexpose.c | 2 +- record/record.c | 2 +- render/filter.c | 4 ++-- render/render.c | 2 +- test/xi2/protocol-common.c | 2 +- xfixes/cursor.c | 2 +- xkb/xkbInit.c | 2 +- 28 files changed, 65 insertions(+), 65 deletions(-) diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 8c0c743076..9d386534d6 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -396,7 +396,7 @@ XineramaInitData(void) RegionUninit(&ScreenRegion); }); - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); PanoramiXPixWidth = firstScreen->x + firstScreen->width; PanoramiXPixHeight = firstScreen->y + firstScreen->height; @@ -425,7 +425,7 @@ PanoramiXExtensionInit(void) int i; Bool success = FALSE; ExtensionEntry *extEntry; - ScreenPtr pScreen = dixGetFirstScreenPtr(); + ScreenPtr pScreen = dixGetMasterScreen(); if (noPanoramiXExtension) return; @@ -591,7 +591,7 @@ PanoramiXCreateConnectionBlock(void) return FALSE; } - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); for (unsigned int walkScreenIdx = 1; walkScreenIdx < screenInfo.numScreens; walkScreenIdx++) { ScreenPtr walkScreen = screenInfo.screens[walkScreenIdx]; @@ -779,7 +779,7 @@ extern void PanoramiXConsolidate(void) { int i; - ScreenPtr pScreen = dixGetFirstScreenPtr(); + ScreenPtr pScreen = dixGetMasterScreen(); DepthPtr pDepth = pScreen->allowedDepths; VisualPtr pVisual = pScreen->visuals; @@ -1240,7 +1240,7 @@ XineramaGetImageData(DrawablePtr *pDrawables, SrcBox.x1 = left; SrcBox.y1 = top; if (!isRoot) { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); SrcBox.x1 += pDraw->x + firstScreen->x; SrcBox.y1 += pDraw->y + firstScreen->y; } diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 261551ea14..c5daf898ba 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -132,7 +132,7 @@ PanoramiXCreateWindow(ClientPtr client) orig_x = stuff->x; orig_y = stuff->y; - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); Bool parentIsRoot = (stuff->parent == firstScreen->root->drawable.id) || (stuff->parent == firstScreen->screensaver.wid); @@ -344,7 +344,7 @@ PanoramiXReparentWindow(ClientPtr client) x = stuff->x; y = stuff->y; - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); Bool parentIsRoot = (stuff->parent == firstScreen->root->drawable.id) || (stuff->parent == firstScreen->screensaver.wid); @@ -505,7 +505,7 @@ PanoramiXConfigureWindow(ClientPtr client) } } - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); if (pWin->parent && ((pWin->parent == firstScreen->root) || (pWin->parent->drawable.id == firstScreen->screensaver.wid))) { @@ -575,7 +575,7 @@ PanoramiXGetGeometry(ClientPtr client) if (rc != Success) return rc; - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); xGetGeometryReply reply = { .root = firstScreen->root->drawable.id, @@ -636,7 +636,7 @@ PanoramiXTranslateCoords(ClientPtr client) if (rc != Success) return rc; - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); if ((pWin == firstScreen->root) || (pWin->drawable.id == firstScreen->screensaver.wid)) { @@ -1167,7 +1167,7 @@ PanoramiXCopyArea(ClientPtr client) dx = drawables[0]->x; dy = drawables[0]->y; if (srcIsRoot) { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); dx += firstScreen->x; dy += firstScreen->y; } @@ -2033,7 +2033,7 @@ PanoramiXGetImage(ClientPtr client) return BadMatch; } else { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); /* check for being onscreen and inside of border */ if (firstScreen->x + pDraw->x + x < 0 || firstScreen->x + pDraw->x + x + w > PanoramiXPixWidth || diff --git a/Xext/shm.c b/Xext/shm.c index 87e7860e6c..11e84aeece 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -813,7 +813,7 @@ ProcShmGetImage(ClientPtr client) return BadMatch; } else { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); if ( /* check for being onscreen */ firstScreen->x + pDraw->x + x < 0 || firstScreen->x + pDraw->x + x + w > PanoramiXPixWidth || diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c index 55be826f5b..7f6f77eb35 100644 --- a/Xext/xvdisp.c +++ b/Xext/xvdisp.c @@ -1544,7 +1544,7 @@ void XineramifyXv(void) { XvScreenPtr xvsp0 = - dixLookupPrivate(&(dixGetFirstScreenPtr()->devPrivates), XvGetScreenKey()); + dixLookupPrivate(&(dixGetMasterScreen()->devPrivates), XvGetScreenKey()); XvAdaptorPtr MatchingAdaptors[MAXSCREENS]; int i; diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c index 76e49d6292..48067dbc4a 100644 --- a/Xi/xiquerypointer.c +++ b/Xi/xiquerypointer.c @@ -172,7 +172,7 @@ ProcXIQueryPointer(ClientPtr client) #ifdef XINERAMA if (!noPanoramiXExtension) { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); rep.root_x += double_to_fp1616(firstScreen->x); rep.root_y += double_to_fp1616(firstScreen->y); if (stuff->win == rep.root) { diff --git a/composite/compext.c b/composite/compext.c index abc1b80987..3f246ce138 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -786,7 +786,7 @@ ProcCompositeGetOverlayWindow(ClientPtr client) return rc; } - CompScreenPtr cs = GetCompScreen(dixGetFirstScreenPtr()); + CompScreenPtr cs = GetCompScreen(dixGetMasterScreen()); if (!cs->pOverlayWin) { if (!(overlayWin = calloc(1, sizeof(PanoramiXRes)))) return BadAlloc; @@ -847,7 +847,7 @@ ProcCompositeGetOverlayWindow(ClientPtr client) AddResource(overlayWin->info[0].id, XRT_WINDOW, overlayWin); } - cs = GetCompScreen(dixGetFirstScreenPtr()); + cs = GetCompScreen(dixGetMasterScreen()); rep = (xCompositeGetOverlayWindowReply) { .overlayWin = cs->pOverlayWin->drawable.id diff --git a/dix/devices.c b/dix/devices.c index f4c0e23a35..8ee338dc27 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -379,7 +379,7 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent) if (InputDevIsMaster(dev)) { /* Sprites appear on first root window, so we can hardcode it */ if (dev->spriteInfo->spriteOwner) { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); InitializeSprite(dev, firstScreen->root); /* mode doesn't matter */ EnterWindow(dev, firstScreen->root, NotifyAncestor); @@ -591,7 +591,7 @@ int ActivateDevice(DeviceIntPtr dev, BOOL sendevent) { int ret = Success; - ScreenPtr pScreen = dixGetFirstScreenPtr(); + ScreenPtr pScreen = dixGetMasterScreen(); if (!dev || !dev->deviceProc) return BadImplementation; @@ -674,7 +674,7 @@ CorePointerProc(DeviceIntPtr pDev, int what) BYTE map[NBUTTONS + 1]; Atom btn_labels[NBUTTONS] = { 0 }; Atom axes_labels[NAXES] = { 0 }; - ScreenPtr scr = dixGetFirstScreenPtr(); + ScreenPtr scr = dixGetMasterScreen(); switch (what) { case DEVICE_INIT: @@ -989,7 +989,7 @@ FreePendingFrozenDeviceEvents(DeviceIntPtr dev) static void CloseDevice(DeviceIntPtr dev) { - ScreenPtr screen = dixGetFirstScreenPtr(); + ScreenPtr screen = dixGetMasterScreen(); ClassesPtr classes; if (!dev) @@ -1144,7 +1144,7 @@ AbortDevices(void) void UndisplayDevices(void) { - ScreenPtr screen = dixGetFirstScreenPtr(); + ScreenPtr screen = dixGetMasterScreen(); for (DeviceIntPtr dev = inputInfo.devices; dev; dev = dev->next) screen->DisplayCursor(dev, screen, NullCursor); @@ -1186,7 +1186,7 @@ int RemoveDevice(DeviceIntPtr dev, BOOL sendevent) { int ret = BadMatch; - ScreenPtr screen = dixGetFirstScreenPtr(); + ScreenPtr screen = dixGetMasterScreen(); int deviceid; int initialized; int flags[MAXDEVICES] = { 0 }; @@ -2634,7 +2634,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) if (dev->spriteInfo->sprite) currentRoot = InputDevCurrentRootWindow(dev); else /* new device auto-set to floating */ - currentRoot = dixGetFirstScreenPtr()->root; + currentRoot = dixGetMasterScreen()->root; /* we need to init a fake sprite */ screen = currentRoot->drawable.pScreen; diff --git a/dix/dixfonts.c b/dix/dixfonts.c index 9d701ad743..309731a077 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1869,7 +1869,7 @@ get_client_resolutions(int *num) static struct _FontResolution res; ScreenPtr pScreen; - pScreen = dixGetFirstScreenPtr(); + pScreen = dixGetMasterScreen(); res.x_resolution = (pScreen->width * 25.4) / pScreen->mmWidth; /* * XXX - we'll want this as long as bitmap instances are prevalent diff --git a/dix/events.c b/dix/events.c index cf35046847..83a9800d33 100644 --- a/dix/events.c +++ b/dix/events.c @@ -539,7 +539,7 @@ XineramaSetCursorPosition(DeviceIntPtr pDev, int x, int y, Bool generateEvent) to send the message too and what the coordinates relative to that screen are. */ - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); x += firstScreen->x; y += firstScreen->y; @@ -572,7 +572,7 @@ XineramaConstrainCursor(DeviceIntPtr pDev) ScreenPtr pScreen = pSprite->screen; BoxRec newBox = pSprite->physLimits; - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); /* Translate the constraining box to the screen the sprite is actually on */ @@ -589,7 +589,7 @@ XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin) { SpritePtr pSprite = pDev->spriteInfo->sprite; - if (pWin == dixGetFirstScreenPtr()->root) { + if (pWin == dixGetMasterScreen()->root) { XINERAMA_FOR_EACH_SCREEN_BACKWARD({ pSprite->windows[walkScreenIdx] = walkScreen->root; }); @@ -658,7 +658,7 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev, pSprite->confined = FALSE; pSprite->confineWin = - (pWin == dixGetFirstScreenPtr()->root) ? NullWindow : pWin; + (pWin == dixGetMasterScreen()->root) ? NullWindow : pWin; CheckPhysLimits(pDev, pSprite->current, generateEvents, FALSE, NULL); } @@ -1185,7 +1185,7 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device) if (event->type == ET_Motion) { #ifdef XINERAMA if (!noPanoramiXExtension) { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); event->root_x += pSprite->screen->x - firstScreen->x; event->root_y += pSprite->screen->y - firstScreen->y; } @@ -1238,7 +1238,7 @@ PlayReleasedEvents(void) DeviceIntPtr dev; DeviceIntPtr pDev; #ifdef XINERAMA - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); #endif restart: @@ -3015,7 +3015,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y) if (!noPanoramiXExtension && XineramaSetWindowPntrs(inputInfo.pointer, pWin)) { SpritePtr pSprite = inputInfo.pointer->spriteInfo->sprite; - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); XINERAMA_FOR_EACH_SCREEN_FORWARD_SKIP0({ if (RegionContainsPoint(&pSprite->windows[walkScreenIdx]->borderSize, @@ -3171,7 +3171,7 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev) /* Motion events entering DIX get translated to Screen 0 coordinates. Replayed events have already been translated since they've entered DIX before */ - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); ev->root_x += pSprite->screen->x - firstScreen->x; ev->root_y += pSprite->screen->y - firstScreen->y; } @@ -3344,7 +3344,7 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin) pSprite->spriteTrace = NULL; pSprite->spriteTraceSize = 0; pSprite->spriteTraceGood = 0; - pSprite->pEnqueueScreen = dixGetFirstScreenPtr(); + pSprite->pEnqueueScreen = dixGetMasterScreen(); pSprite->pDequeueScreen = pSprite->pEnqueueScreen; } pCursor = RefCursor(pCursor); @@ -3365,7 +3365,7 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin) } #ifdef XINERAMA if (!noPanoramiXExtension) { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); pSprite->hotLimits.x1 = -firstScreen->x; pSprite->hotLimits.y1 = -firstScreen->y; pSprite->hotLimits.x2 = PanoramiXPixWidth - firstScreen->x; @@ -3446,7 +3446,7 @@ UpdateSpriteForScreen(DeviceIntPtr pDev, ScreenPtr pScreen) #ifdef XINERAMA if (!noPanoramiXExtension) { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); pSprite->hotLimits.x1 = -firstScreen->x; pSprite->hotLimits.y1 = -firstScreen->y; pSprite->hotLimits.x2 = PanoramiXPixWidth - firstScreen->x; @@ -3487,7 +3487,7 @@ NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y) pSprite->hotPhys.y = y; #ifdef XINERAMA if (!noPanoramiXExtension) { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); pSprite->hotPhys.x += newScreen->x - firstScreen->x; pSprite->hotPhys.y += newScreen->y - firstScreen->y; if (newScreen != pSprite->screen) { @@ -3534,7 +3534,7 @@ XineramaPointInWindowIsVisible(WindowPtr pWin, int x, int y) if (!XineramaSetWindowPntrs(inputInfo.pointer, pWin)) return FALSE; - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); xoff = x + firstScreen->x; yoff = y + firstScreen->y; @@ -3573,7 +3573,7 @@ XineramaWarpPointer(ClientPtr client) x = pSprite->hotPhys.x; y = pSprite->hotPhys.y; - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); if (stuff->srcWid != None) { int winX, winY; @@ -5369,7 +5369,7 @@ ProcQueryPointer(ClientPtr client) #ifdef XINERAMA if (!noPanoramiXExtension) { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); rep.rootX += firstScreen->x; rep.rootY += firstScreen->y; if (stuff->id == rep.root) { @@ -6039,7 +6039,7 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) XkbFilterEvents(pClient, count, events); #ifdef XINERAMA - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); if (!noPanoramiXExtension && (firstScreen->x || firstScreen->y)) { switch (events->u.u.type) { case MotionNotify: diff --git a/dix/gestures.c b/dix/gestures.c index c0e192b38a..9f0934d701 100644 --- a/dix/gestures.c +++ b/dix/gestures.c @@ -53,7 +53,7 @@ GestureInitGestureInfo(GestureInfoPtr gi) if (!gi->sprite.spriteTrace) { return FALSE; } - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); gi->sprite.spriteTraceSize = 32; gi->sprite.spriteTrace[0] = firstScreen->root; diff --git a/dix/getevents.c b/dix/getevents.c index 762d584e66..da4ae87d6a 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -2119,7 +2119,7 @@ PostSyntheticMotion(DeviceIntPtr pDev, will translate from sprite screen to screen 0 upon reentry to the DIX layer. */ if (!noPanoramiXExtension) { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); x += firstScreen->x - screenInfo.screens[screen]->x; y += firstScreen->y - screenInfo.screens[screen]->y; } diff --git a/dix/glyphcurs.c b/dix/glyphcurs.c index ea7951c8da..dea29fd4b5 100644 --- a/dix/glyphcurs.c +++ b/dix/glyphcurs.c @@ -86,7 +86,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm, char2b[0] = (unsigned char) (ch >> 8); char2b[1] = (unsigned char) (ch & 0xff); - ScreenPtr pScreen = dixGetFirstScreenPtr(); + ScreenPtr pScreen = dixGetMasterScreen(); pbits = calloc(BitmapBytePad(cm->width), cm->height); if (!pbits) return BadAlloc; diff --git a/dix/screenint_priv.h b/dix/screenint_priv.h index 98155936d2..e0554ee4a6 100644 --- a/dix/screenint_priv.h +++ b/dix/screenint_priv.h @@ -24,7 +24,7 @@ void DetachUnboundGPU(ScreenPtr unbound); void AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr newScreen); void DetachOffloadGPU(ScreenPtr slave); -static inline ScreenPtr dixGetFirstScreenPtr(void) { +static inline ScreenPtr dixGetMasterScreen(void) { return screenInfo.screens[0]; } diff --git a/dix/touch.c b/dix/touch.c index e2e7bffb4a..8e8f4b28dc 100644 --- a/dix/touch.c +++ b/dix/touch.c @@ -223,7 +223,7 @@ TouchInitTouchPoint(TouchClassPtr t, ValuatorClassPtr v, int index) } ti->sprite.spriteTraceSize = 32; - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); ti->sprite.spriteTrace[0] = firstScreen->root; ti->sprite.hot.pScreen = firstScreen; diff --git a/dix/window.c b/dix/window.c index 1f58f0dc52..d4c853fbd4 100644 --- a/dix/window.c +++ b/dix/window.c @@ -2269,7 +2269,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) event.u.u.detail = (mask & CWStackMode) ? smode : Above; #ifdef XINERAMA if (!noPanoramiXExtension && (!pParent || !pParent->parent)) { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); event.u.configureRequest.x += firstScreen->x; event.u.configureRequest.y += firstScreen->y; } @@ -2353,7 +2353,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) event.u.u.type = ConfigureNotify; #ifdef XINERAMA if (!noPanoramiXExtension && (!pParent || !pParent->parent)) { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); event.u.configureNotify.x += firstScreen->x; event.u.configureNotify.y += firstScreen->y; } @@ -2499,7 +2499,7 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent, event.u.u.type = ReparentNotify; #ifdef XINERAMA if (!noPanoramiXExtension && !pParent->parent) { - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); event.u.reparent.x += firstScreen->x; event.u.reparent.y += firstScreen->y; } diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 3d77f2617f..f6c6841934 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -1526,11 +1526,11 @@ void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum) { if (axnum == 0) { - dev->valuator->axisVal[0] = dixGetFirstScreenPtr()->width / 2; + dev->valuator->axisVal[0] = dixGetMasterScreen()->width / 2; dev->last.valuators[0] = dev->valuator->axisVal[0]; } else if (axnum == 1) { - dev->valuator->axisVal[1] = dixGetFirstScreenPtr()->height / 2; + dev->valuator->axisVal[1] = dixGetMasterScreen()->height / 2; dev->last.valuators[1] = dev->valuator->axisVal[1]; } } diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index df78f778e0..3bb3695a36 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -585,7 +585,7 @@ void DarwinAdjustScreenOrigins(void) { int i, left, top; - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); left = firstScreen->x; top = firstScreen->y; diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index 7939d65e6b..53f16f8a94 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -252,7 +252,7 @@ QuartzUpdateScreens(void) return; } - pScreen = dixGetFirstScreenPtr(); + pScreen = dixGetMasterScreen(); PseudoramiXResetScreens(); quartzProcs->AddPseudoramiXScreens(&x, &y, &width, &height, pScreen); diff --git a/hw/xquartz/quartzRandR.c b/hw/xquartz/quartzRandR.c index 8a1960e665..e0c7ebc61a 100644 --- a/hw/xquartz/quartzRandR.c +++ b/hw/xquartz/quartzRandR.c @@ -426,7 +426,7 @@ _QuartzRandRUpdateFakeModes(ScreenPtr pScreen) Bool QuartzRandRUpdateFakeModes(BOOL force_update) { - ScreenPtr pScreen = dixGetFirstScreenPtr(); + ScreenPtr pScreen = dixGetMasterScreen(); if (ignore_next_fake_mode_update) { DEBUG_LOG( @@ -496,7 +496,7 @@ QuartzRandRSetFakeFullscreen(BOOL state) void QuartzRandRToggleFullscreen(void) { - ScreenPtr pScreen = dixGetFirstScreenPtr(); + ScreenPtr pScreen = dixGetMasterScreen(); QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen); if (pQuartzScreen->currentMode.ref == NULL) { diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c index 317ba4a009..05964964aa 100644 --- a/hw/xwin/winkeybd.c +++ b/hw/xwin/winkeybd.c @@ -257,7 +257,7 @@ winRestoreModeKeyStates(void) /* Only process events if the rootwindow is mapped. The keyboard events * will cause segfaults otherwise */ - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); if (firstScreen->root && firstScreen->root->mapped == FALSE) processEvents = FALSE; diff --git a/hw/xwin/winmsgwindow.c b/hw/xwin/winmsgwindow.c index 2ef09eaa57..26ce88c2e4 100644 --- a/hw/xwin/winmsgwindow.c +++ b/hw/xwin/winmsgwindow.c @@ -58,7 +58,7 @@ winMsgWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) has set the DE_TERMINATE flag so exits the msg dispatch loop. */ { - ScreenPtr pScreen = dixGetFirstScreenPtr(); + ScreenPtr pScreen = dixGetMasterScreen(); winScreenPriv(pScreen); PostMessage(pScreenPriv->hwndScreen, WM_GIVEUP, 0, 0); diff --git a/mi/miexpose.c b/mi/miexpose.c index 85e1924ffe..ec6f578337 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -328,7 +328,7 @@ miSendExposures(WindowPtr pWin, RegionPtr pRgn, int dx, int dy) if (!pWin->parent) { x = screenInfo.screens[scrnum]->x; y = screenInfo.screens[scrnum]->y; - pWin = dixGetFirstScreenPtr()->root; + pWin = dixGetMasterScreen()->root; realWin = pWin->drawable.id; } else if (scrnum) { diff --git a/record/record.c b/record/record.c index 6738d2b01b..2cc61000dc 100644 --- a/record/record.c +++ b/record/record.c @@ -726,7 +726,7 @@ RecordSendProtocolEvents(RecordClientsAndProtocolPtr pRCAP, pev->u.u.type == ButtonRelease || pev->u.u.type == KeyPress || pev->u.u.type == KeyRelease)) { int scr = inputInfo.pointer->spriteInfo->sprite->screen->myNum; - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); memcpy(&shiftedEvent, pev, sizeof(xEvent)); shiftedEvent.u.keyButtonPointer.rootX += diff --git a/render/filter.c b/render/filter.c index 463fb4fb15..633a960d36 100644 --- a/render/filter.c +++ b/render/filter.c @@ -331,7 +331,7 @@ SetPictureFilter(PicturePtr pPicture, char *name, int len, xFixed * params, if (pPicture->pDrawable != NULL) pScreen = pPicture->pDrawable->pScreen; else - pScreen = dixGetFirstScreenPtr(); + pScreen = dixGetMasterScreen(); pFilter = PictureFindFilter(pScreen, name, len); @@ -362,7 +362,7 @@ SetPicturePictFilter(PicturePtr pPicture, PictFilterPtr pFilter, if (pPicture->pDrawable) pScreen = pPicture->pDrawable->pScreen; else - pScreen = dixGetFirstScreenPtr(); + pScreen = dixGetMasterScreen(); if (pFilter->ValidateParams) { int width, height; diff --git a/render/render.c b/render/render.c index 37e5d50dd0..a4ee8afc51 100644 --- a/render/render.c +++ b/render/render.c @@ -2499,7 +2499,7 @@ PanoramiXRenderCreatePicture(ClientPtr client) panoramix_setup_ids(newPict, client, stuff->pid); if (refDraw->type == XRT_WINDOW && - stuff->drawable == dixGetFirstScreenPtr()->root->drawable.id) { + stuff->drawable == dixGetMasterScreen()->root->drawable.id) { newPict->u.pict.root = TRUE; } else diff --git a/test/xi2/protocol-common.c b/test/xi2/protocol-common.c index 5144f93b68..68575587eb 100644 --- a/test/xi2/protocol-common.c +++ b/test/xi2/protocol-common.c @@ -110,7 +110,7 @@ TestPointerProc(DeviceIntPtr pDev, int what) pDev->name); return BadAlloc; } - ScreenPtr firstScreen = dixGetFirstScreenPtr(); + ScreenPtr firstScreen = dixGetMasterScreen(); pDev->valuator->axisVal[0] = firstScreen->width / 2; pDev->last.valuators[0] = pDev->valuator->axisVal[0]; pDev->valuator->axisVal[1] = firstScreen->height / 2; diff --git a/xfixes/cursor.c b/xfixes/cursor.c index feb41b13f6..924f2ec9ea 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -619,7 +619,7 @@ ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, void *closure) } } /* this "knows" that WindowHasNewCursor doesn't depend on its argument */ - WindowHasNewCursor(dixGetFirstScreenPtr()->root); + WindowHasNewCursor(dixGetMasterScreen()->root); } static Bool diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index 26d515f502..458bae11ce 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -193,7 +193,7 @@ XkbWriteRulesProp(void) ErrorF("[xkb] Internal Error! bad size (%d!=%d) for _XKB_RULES_NAMES\n", out, len); } - dixChangeWindowProperty(serverClient, dixGetFirstScreenPtr()->root, name, + dixChangeWindowProperty(serverClient, dixGetMasterScreen()->root, name, XA_STRING, 8, PropModeReplace, len, pval, TRUE); free(pval); return TRUE;