Skip to content

Commit 603e542

Browse files
committed
Remove maximum size limits for nxagent window
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
1 parent 0ada0a1 commit 603e542

File tree

2 files changed

+15
-43
lines changed

2 files changed

+15
-43
lines changed

nx-X11/programs/Xserver/hw/nxagent/Events.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,8 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
593593

594594
if (nxagentOption(Fullscreen) == 0)
595595
{
596-
sizeHints.max_width = nxagentOption(RootWidth);
597-
sizeHints.max_height = nxagentOption(RootHeight);
596+
sizeHints.max_width = MAXSHORT;
597+
sizeHints.max_height = MAXSHORT;
598598

599599
XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum],
600600
&sizeHints);
@@ -614,8 +614,8 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
614614
NXSetExposeParameters(nxagentDisplay, 0, 0, 0);
615615
}
616616

617-
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
618-
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
617+
sizeHints.max_width = MAXSHORT;
618+
sizeHints.max_height = MAXSHORT;
619619

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

642-
sizeHints.max_width = nxagentOption(RootWidth);
643-
sizeHints.max_height = nxagentOption(RootHeight);
644-
645642
fprintf(stderr,"Info: Disabled resize mode in shadow agent.\n");
646643
}
647644
else
@@ -655,12 +652,12 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen)
655652
screenInfo.screens[0]->root, screenInfo.screens[0]->root -> drawable.width,
656653
screenInfo.screens[0]->root -> drawable.height);
657654

658-
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
659-
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
660-
661655
fprintf(stderr,"Info: Enabled resize mode in shadow agent.\n");
662656
}
663657

658+
sizeHints.max_width = MAXSHORT;
659+
sizeHints.max_height = MAXSHORT;
660+
664661
XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum],
665662
&sizeHints);
666663
}

nx-X11/programs/Xserver/hw/nxagent/Screen.c

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,16 +1852,8 @@ N/A
18521852
sizeHints.width = nxagentOption(RootWidth);
18531853
sizeHints.height = nxagentOption(RootHeight);
18541854

1855-
if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1)
1856-
{
1857-
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
1858-
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
1859-
}
1860-
else
1861-
{
1862-
sizeHints.max_width = nxagentOption(RootWidth);
1863-
sizeHints.max_height = nxagentOption(RootHeight);
1864-
}
1855+
sizeHints.max_width = MAXSHORT;
1856+
sizeHints.max_height = MAXSHORT;
18651857

18661858
if (nxagentUserGeometry.flag & XValue || nxagentUserGeometry.flag & YValue)
18671859
sizeHints.flags |= USPosition;
@@ -2374,17 +2366,8 @@ FIXME: We should try to restore the previously
23742366
sizeHints.min_height = MIN_NXAGENT_HEIGHT;
23752367
sizeHints.width = width;
23762368
sizeHints.height = height;
2377-
2378-
if (nxagentOption(DesktopResize) == 1)
2379-
{
2380-
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
2381-
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
2382-
}
2383-
else
2384-
{
2385-
sizeHints.max_width = nxagentOption(RootWidth);
2386-
sizeHints.max_height = nxagentOption(RootHeight);
2387-
}
2369+
sizeHints.max_width = MAXSHORT;
2370+
sizeHints.max_height = MAXSHORT;
23882371

23892372
if (nxagentUserGeometry.flag & XValue || nxagentUserGeometry.flag & YValue)
23902373
{
@@ -4412,16 +4395,8 @@ void nxagentSetWMNormalHints(int screen)
44124395
sizeHints.width = nxagentOption(Width);
44134396
sizeHints.height = nxagentOption(Height);
44144397

4415-
if (nxagentOption(DesktopResize) == 1)
4416-
{
4417-
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
4418-
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
4419-
}
4420-
else
4421-
{
4422-
sizeHints.max_width = nxagentOption(RootWidth);
4423-
sizeHints.max_height = nxagentOption(RootHeight);
4424-
}
4398+
sizeHints.max_width = MAXSHORT;
4399+
sizeHints.max_height = MAXSHORT;
44254400

44264401
if (nxagentUserGeometry.flag & XValue || nxagentUserGeometry.flag & YValue)
44274402
{
@@ -4450,8 +4425,8 @@ void nxagentShadowAdaptToRatio(void)
44504425

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

4453-
sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
4454-
sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
4428+
sizeHints.max_width = MAXSHORT;
4429+
sizeHints.max_height = MAXSHORT;
44554430

44564431
sizeHints.flags = PMaxSize;
44574432

0 commit comments

Comments
 (0)