aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Screen.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-05-19 20:59:02 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-10-17 22:38:05 +0200
commit8deda7bd4f1ada976010c2edcd7cab9a4bdf8140 (patch)
tree57e5843d2307812aada89e3d105014040dc1366c /nx-X11/programs/Xserver/hw/nxagent/Screen.c
parentabe5e8479aca9f53ed4778336978bf7bd623c56a (diff)
downloadnx-libs-8deda7bd4f1ada976010c2edcd7cab9a4bdf8140.tar.gz
nx-libs-8deda7bd4f1ada976010c2edcd7cab9a4bdf8140.tar.bz2
nx-libs-8deda7bd4f1ada976010c2edcd7cab9a4bdf8140.zip
nxagent: Prevent resize loop
This only happened with certain window managers like mutter. Fixes ArcticaProject/nx-libs#925
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Screen.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index 4654bbfcd..52ecea854 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -2243,7 +2243,7 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable)
}
Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
- int mmWidth, int mmHeight)
+ int mmWidth, int mmHeight, Bool doresize)
{
#ifdef TEST
nxagentPrintAgentGeometry("Before Resize Screen", "nxagentResizeScreen:");
@@ -2365,10 +2365,19 @@ FIXME: We should try to restore the previously
{
nxagentSetWMNormalHints(pScreen->myNum, width, height);
- XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height);
+ if (doresize)
+ {
+ #ifdef DEBUG
+ fprintf(stderr, "%s: resizing DefaultWindow to [%d]x[%d]\n", __func__, width, height);
+ #endif
+ XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height);
+ }
if (nxagentOption(Rootless) == 0)
{
+ #ifdef DEBUG
+ fprintf(stderr, "%s: resizing InputWindow to [%d]x[%d]\n", __func__, width, height);
+ #endif
XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], width, height);
}
}
@@ -2691,7 +2700,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
AddResource(accessWindowID, RT_WINDOW, (void *)nxagentShadowWindowPtr);
- nxagentResizeScreen(pScreen, nxagentShadowWidth, nxagentShadowHeight, pScreen -> mmWidth, pScreen -> mmHeight);
+ nxagentResizeScreen(pScreen, nxagentShadowWidth, nxagentShadowHeight, pScreen -> mmWidth, pScreen -> mmHeight, True);
nxagentShadowCreateMainWindow(pScreen, pWin, nxagentShadowWidth, nxagentShadowHeight);
@@ -3646,10 +3655,10 @@ void nxagentAdjustCustomMode(ScreenPtr pScreen)
RRScreenSizeNotify(pScreen);
}
-int nxagentChangeScreenConfig(int screen, int width, int height)
+int nxagentChangeScreenConfig(int screen, int width, int height, Bool doresize)
{
#ifdef DEBUG
- fprintf(stderr, "nxagentChangeScreenConfig: called for screen [%d], width [%d] height [%d]\n", screen, width, height);
+ fprintf(stderr, "nxagentChangeScreenConfig: called for screen [%d], width [%d] height [%d] doresize [%d]\n", screen, width, height, doresize);
#endif
#ifdef TEST
@@ -3697,7 +3706,7 @@ int nxagentChangeScreenConfig(int screen, int width, int height)
fprintf(stderr, "nxagentChangeScreenConfig: Changing config to %d x %d\n", width, height);
#endif
- int r = nxagentResizeScreen(pScreen, width, height, 0, 0);
+ int r = nxagentResizeScreen(pScreen, width, height, 0, 0, doresize);
if (r != 0)
{