From d5cddf4b0437c4faac7f9c52a4f40c598d445a0e Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 12 Jul 2021 17:03:36 +0200 Subject: [PATCH] Use central SetRootClip() There's been a common one since X.org 1.11, so use that instead of our own copy. --- unix/xserver/hw/vnc/xvnc.c | 94 ++------------------------------------ 1 file changed, 4 insertions(+), 90 deletions(-) diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c index 666b5ec8..e8f71edd 100644 --- a/unix/xserver/hw/vnc/xvnc.c +++ b/unix/xserver/hw/vnc/xvnc.c @@ -695,92 +695,6 @@ vncRandRGetInfo(ScreenPtr pScreen, Rotation * rotations) return TRUE; } -/* from hw/xfree86/common/xf86Helper.c */ - -#include "mivalidate.h" -static void -xf86SetRootClip(ScreenPtr pScreen, Bool enable) -{ - WindowPtr pWin = pScreen->root; - WindowPtr pChild; - Bool WasViewable = (Bool) (pWin->viewable); - Bool anyMarked = FALSE; - WindowPtr pLayerWin; - BoxRec box; - - if (WasViewable) { - for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { - (void) (*pScreen->MarkOverlappedWindows) (pChild, - pChild, &pLayerWin); - } - (*pScreen->MarkWindow) (pWin); - anyMarked = TRUE; - if (pWin->valdata) { - if (HasBorder(pWin)) { - RegionPtr borderVisible; - - borderVisible = RegionCreate(NullBox, 1); - RegionSubtract(borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - pWin->valdata->before.resized = TRUE; - } - } - - /* - * Use RegionBreak to avoid optimizations in ValidateTree - * that assume the root borderClip can't change well, normally - * it doesn't...) - */ - if (enable) { - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - RegionInit(&pWin->winSize, &box, 1); - RegionInit(&pWin->borderSize, &box, 1); - if (WasViewable) - RegionReset(&pWin->borderClip, &box); - pWin->drawable.width = pScreen->width; - pWin->drawable.height = pScreen->height; - RegionBreak(&pWin->clipList); - } - else { - RegionEmpty(&pWin->borderClip); - RegionBreak(&pWin->clipList); - } - - ResizeChildrenWinSize(pWin, 0, 0, 0, 0); - - if (WasViewable) { - - if (pWin->firstChild) { - anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin->firstChild, - pWin->firstChild, - (WindowPtr *) NULL); - } - else { - (*pScreen->MarkWindow) (pWin); - anyMarked = TRUE; - } - - if (anyMarked) - (*pScreen->ValidateTree) (pWin, NullWindow, VTOther); - } - - if (WasViewable) { - if (anyMarked) - (*pScreen->HandleExposures) (pWin); - - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pWin, NullWindow, VTOther); - } - if (pWin->realized) - WindowsRestructured(); - FlushAllOutput(); -} - static Bool vncRandRCrtcSet(ScreenPtr pScreen, RRCrtcPtr crtc, RRModePtr mode, int x, int y, Rotation rotation, int num_outputs, RROutputPtr * outputs); @@ -800,7 +714,7 @@ vncRandRScreenSetSize(ScreenPtr pScreen, int oldwidth, oldheight, oldmmWidth, oldmmHeight; /* Prevent updates while we fiddle */ - xf86SetRootClip(pScreen, FALSE); + SetRootClip(pScreen, ROOT_CLIP_NONE); /* Store current state in case we fail */ oldwidth = pScreen->width; @@ -829,7 +743,7 @@ vncRandRScreenSetSize(ScreenPtr pScreen, pScreen->mmWidth = oldmmWidth; pScreen->mmHeight = oldmmHeight; - xf86SetRootClip(pScreen, TRUE); + SetRootClip(pScreen, ROOT_CLIP_FULL); return FALSE; } @@ -846,7 +760,7 @@ vncRandRScreenSetSize(ScreenPtr pScreen, pScreen->mmWidth = oldmmWidth; pScreen->mmHeight = oldmmHeight; - xf86SetRootClip(pScreen, TRUE); + SetRootClip(pScreen, ROOT_CLIP_FULL); return FALSE; } @@ -860,7 +774,7 @@ vncRandRScreenSetSize(ScreenPtr pScreen, vncFbstride[pScreen->myNum] = fb.paddedWidth; /* Restore ability to update screen, now with new dimensions */ - xf86SetRootClip(pScreen, TRUE); + SetRootClip(pScreen, ROOT_CLIP_FULL); /* * Let RandR know we changed something (it doesn't assume that -- 2.39.5