Skip to content

Commit

Permalink
Remove maximum size limits for nxagent window
Browse files Browse the repository at this point in the history
Set maximum size to MAXSHORT (32767).

This especially helps when reconnecting to a session that had
initially been started from a client with a small(er) screen. Before
it was impossible to increase the maximum size of a running session
beyond the screen size of the client that had initiated the session.

This change, together with the previous commit, fixes #472
  • Loading branch information
uli42 committed Jul 3, 2017
1 parent 0ada0a1 commit 603e542
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 43 deletions.
17 changes: 7 additions & 10 deletions nx-X11/programs/Xserver/hw/nxagent/Events.c
Expand Up @@ -593,8 +593,8 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)

if (nxagentOption(Fullscreen) == 0)
{
sizeHints.max_width = nxagentOption(RootWidth);
sizeHints.max_height = nxagentOption(RootHeight);
sizeHints.max_width = MAXSHORT;
sizeHints.max_height = MAXSHORT;

XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum],
&sizeHints);
Expand All @@ -614,8 +614,8 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
NXSetExposeParameters(nxagentDisplay, 0, 0, 0);
}

sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_width = MAXSHORT;
sizeHints.max_height = MAXSHORT;

XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum],
&sizeHints);
Expand All @@ -639,9 +639,6 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen)
nxagentShadowCreateMainWindow(screenInfo.screens[DefaultScreen(nxagentDisplay)], screenInfo.screens[0]->root,
screenInfo.screens[0]->root -> drawable.width, screenInfo.screens[0]->root -> drawable.height);

sizeHints.max_width = nxagentOption(RootWidth);
sizeHints.max_height = nxagentOption(RootHeight);

fprintf(stderr,"Info: Disabled resize mode in shadow agent.\n");
}
else
Expand All @@ -655,12 +652,12 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen)
screenInfo.screens[0]->root, screenInfo.screens[0]->root -> drawable.width,
screenInfo.screens[0]->root -> drawable.height);

sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));

fprintf(stderr,"Info: Enabled resize mode in shadow agent.\n");
}

sizeHints.max_width = MAXSHORT;
sizeHints.max_height = MAXSHORT;

XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum],
&sizeHints);
}
Expand Down
41 changes: 8 additions & 33 deletions nx-X11/programs/Xserver/hw/nxagent/Screen.c
Expand Up @@ -1852,16 +1852,8 @@ N/A
sizeHints.width = nxagentOption(RootWidth);
sizeHints.height = nxagentOption(RootHeight);

if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1)
{
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
else
{
sizeHints.max_width = nxagentOption(RootWidth);
sizeHints.max_height = nxagentOption(RootHeight);
}
sizeHints.max_width = MAXSHORT;
sizeHints.max_height = MAXSHORT;

if (nxagentUserGeometry.flag & XValue || nxagentUserGeometry.flag & YValue)
sizeHints.flags |= USPosition;
Expand Down Expand Up @@ -2374,17 +2366,8 @@ FIXME: We should try to restore the previously
sizeHints.min_height = MIN_NXAGENT_HEIGHT;
sizeHints.width = width;
sizeHints.height = height;

if (nxagentOption(DesktopResize) == 1)
{
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
else
{
sizeHints.max_width = nxagentOption(RootWidth);
sizeHints.max_height = nxagentOption(RootHeight);
}
sizeHints.max_width = MAXSHORT;
sizeHints.max_height = MAXSHORT;

if (nxagentUserGeometry.flag & XValue || nxagentUserGeometry.flag & YValue)
{
Expand Down Expand Up @@ -4412,16 +4395,8 @@ void nxagentSetWMNormalHints(int screen)
sizeHints.width = nxagentOption(Width);
sizeHints.height = nxagentOption(Height);

if (nxagentOption(DesktopResize) == 1)
{
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
else
{
sizeHints.max_width = nxagentOption(RootWidth);
sizeHints.max_height = nxagentOption(RootHeight);
}
sizeHints.max_width = MAXSHORT;
sizeHints.max_height = MAXSHORT;

if (nxagentUserGeometry.flag & XValue || nxagentUserGeometry.flag & YValue)
{
Expand Down Expand Up @@ -4450,8 +4425,8 @@ void nxagentShadowAdaptToRatio(void)

nxagentShadowCreateMainWindow(pScreen, screenInfo.screens[0]->root, nxagentShadowWidth, nxagentShadowHeight);

sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints.max_width = MAXSHORT;
sizeHints.max_height = MAXSHORT;

sizeHints.flags = PMaxSize;

Expand Down

0 comments on commit 603e542

Please sign in to comment.