From a3e0376f95cb57aeda12438313cba67b1690d685 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 29 May 2019 23:52:44 +0200 Subject: Window.c: remove leftover (commented) code This was eventually replaced by nxagentAddConfiguredWindow(pWin, CW_Map) some lines below which is just leading to the same code being executed some time later. (nxagentAddConfiguredWindow() will add a window to a list. nxagentFlushConfiguredWindow() is called at certain points to update all windows in that list in one go. "update" here means calling XConfigureWindow() or XMapWindow() on the real display.) --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Window.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 8307c3de4..7d98d25fe 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -1942,20 +1942,6 @@ Bool nxagentRealizeWindow(WindowPtr pWin) #endif */ - /* - * Mapping of the root window is called by - * InitRootWindow in DIX. Skip the operation - * if we are in rootless mode. - */ - - /* - * if (!nxagentOption(Rootless) || - * nxagentRootlessWindow != pWin) - * { - * XMapWindow(nxagentDisplay, nxagentWindow(pWin)); - * } - */ - #ifdef TEST if (nxagentOption(Rootless) && nxagentLastWindowDestroyed) { -- cgit v1.2.3 From 9f5ddede95086c6f31efe89ed228ac035a89a8e5 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 30 May 2019 00:10:43 +0200 Subject: Window.c: Drop defines CWParent and CWStackingOrder They were just aliases to already existing defines and were not used stringently. So we had mix of aliased and non-aliased uses which is confusing when trying to understand the code... --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Window.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 7d98d25fe..f602d0ed3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -727,7 +727,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) (void *) pWin, nxagentWindow(pWin), x, y); #endif - nxagentAddConfiguredWindow(pWin, CWParent | CWX | CWY | CWWidth | + nxagentAddConfiguredWindow(pWin, CWSibling | CWX | CWY | CWWidth | CWHeight | CWBorderWidth); return True; @@ -1284,7 +1284,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) { if (mask & CW_RootlessRestack) { - mask = CWStackingOrder; + mask = CWStackMode; } } @@ -1299,7 +1299,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) if (mask & CW_Update) { - mask |= CWX | CWY | CWWidth | CWHeight | CWBorderWidth | CWStackingOrder; + mask |= CWX | CWY | CWWidth | CWHeight | CWBorderWidth | CWStackMode; } if (mask & CWX) @@ -1378,7 +1378,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) MAKE_SYNC_CONFIGURE_WINDOW; } - if (mask & CWStackingOrder && + if (mask & CWStackMode && nxagentWindowPriv(pWin)->siblingAbove != nxagentWindowSiblingAbove(pWin)) { WindowPtr pSib; @@ -1478,7 +1478,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) * really needed? * * - * else if (mask & CWStackingOrder) + * else if (mask & CWStackMode) * { * if (nxagentSplashWindow) * { @@ -1920,12 +1920,12 @@ Bool nxagentRealizeWindow(WindowPtr pWin) /* * Not needed. * - * nxagentConfigureWindow(pWin, CWStackingOrder); + * nxagentConfigureWindow(pWin, CWStackMode); * * nxagentFlushConfigureWindow(); */ - nxagentAddConfiguredWindow(pWin, CWStackingOrder); + nxagentAddConfiguredWindow(pWin, CWStackMode); nxagentAddConfiguredWindow(pWin, CW_Shape); /* add by dimbor */ @@ -2116,10 +2116,10 @@ void nxagentCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion) void nxagentClipNotify(WindowPtr pWin, int dx, int dy) { /* - * nxagentConfigureWindow(pWin, CWStackingOrder); + * nxagentConfigureWindow(pWin, CWStackMode); */ - nxagentAddConfiguredWindow(pWin, CWStackingOrder); + nxagentAddConfiguredWindow(pWin, CWStackMode); nxagentAddConfiguredWindow(pWin, CW_Shape); #ifndef NXAGENT_SHAPE @@ -3572,10 +3572,10 @@ void nxagentAddConfiguredWindow(WindowPtr pWin, unsigned int valuemask) { unsigned int mask; - mask = valuemask & (CWParent | CWX | CWY | CWWidth | CWHeight | - CWBorderWidth | CWStackingOrder | CW_Map | CW_Update | CW_Shape); + mask = valuemask & (CWSibling | CWX | CWY | CWWidth | CWHeight | + CWBorderWidth | CWStackMode | CW_Map | CW_Update | CW_Shape); - valuemask &= ~(CWParent | CWX | CWY | CWWidth | CWHeight | CWBorderWidth | CWStackingOrder); + valuemask &= ~(CWSibling | CWX | CWY | CWWidth | CWHeight | CWBorderWidth | CWStackMode); if (mask & CWX && nxagentWindowPriv(pWin)->x != @@ -3612,11 +3612,11 @@ void nxagentAddConfiguredWindow(WindowPtr pWin, unsigned int valuemask) valuemask |= CWBorderWidth; } - if (mask & CWStackingOrder && + if (mask & CWStackMode && nxagentWindowPriv(pWin)->siblingAbove != nxagentWindowSiblingAbove(pWin)) { - valuemask |= CWStackingOrder; + valuemask |= CWStackMode; } { -- cgit v1.2.3 From 1a8de6352d068e0a45904cf9b80bde30561eca2f Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 30 May 2019 00:30:46 +0200 Subject: dix/window.c: fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Window.c:3827:46: warning: array subscript 128 is above array bounds of ‘StoringPixmapRec *[128]’ {aka ‘struct *[128]’} [-Warray-bounds] i, (void *) nxagentBSPixmapList[i]); --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Window.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index f602d0ed3..6758e0875 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -3938,16 +3938,16 @@ int nxagentEmptyBSPixmapList(void) StoringPixmapPtr nxagentFindItemBSPixmapList(unsigned long pixmapId) { - int i; - - for (i = 0; i < BSPIXMAPLIMIT; i++) + for (int i = 0; i < BSPIXMAPLIMIT; i++) { if ((nxagentBSPixmapList[i] != NULL) && (nxagentBSPixmapList[i] -> storingPixmapId == pixmapId)) { #ifdef TEST - fprintf(stderr, "nxagentFindItemBSPixmapList: pixmapId [%lu].\n", pixmapId); - fprintf(stderr, "nxagentFindItemBSPixmapList: nxagentBSPixmapList[%d] -> storingPixmapId [%lu].\n", + fprintf(stderr, "%s: pixmapId [%lu].\n", __func__, pixmapId); + fprintf(stderr, "%s: nxagentBSPixmapList[%d] = [%p].\n", __func__, + i, (void *) nxagentBSPixmapList[i]); + fprintf(stderr, "%s: nxagentBSPixmapList[%d] -> storingPixmapId [%lu].\n", __func__, i, nxagentBSPixmapList[i] -> storingPixmapId); #endif @@ -3955,15 +3955,13 @@ StoringPixmapPtr nxagentFindItemBSPixmapList(unsigned long pixmapId) } } - #ifdef TEST - fprintf(stderr, "nxagentFindItemBSPixmapList: WARNING! Item not found.\n"); + #ifdef WARNING + fprintf(stderr, "%s: WARNING! Item not found.\n", __func__); #endif #ifdef TEST - fprintf(stderr, "nxagentFindItemBSPixmapList: Pixmap with id [%lu] not found.\n", + fprintf(stderr, "%s: Pixmap with id [%lu] not found.\n", __func__, pixmapId); - fprintf(stderr, "nxagentBSPixmapList[%d] = [%p].\n", - i, (void *) nxagentBSPixmapList[i]); #endif return NULL; -- cgit v1.2.3 From 1bfafc127c82b87bbb398bbd7c6984144c3fb3eb Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 30 May 2019 11:38:10 +0200 Subject: Window.c: add missing comment about nxagentConfiguredWindowList was in inital version of 6ce9fb5f2875754f97035d3338b3d0e1d20169ae but got lost during some rebasing/cherry-picking preceeding the pull request. --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Window.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 6758e0875..78a5081f0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -3470,6 +3470,12 @@ void nxagentSetTopLevelEventMask(WindowPtr pWin) } /* + * Run nxagentConfigureWindow() on all windows in + * nxagentConfiguredWindowList and move them from the list + * afterwards. The list will be empty then. + * + * This is also taking care of entries in nxagentExposeQueue that need + * to be synchronized with the real X server. */ void nxagentFlushConfigureWindow(void) { -- cgit v1.2.3