summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/xwin/InitOutput.c14
-rw-r--r--hw/xwin/man/XWin.man3
-rw-r--r--hw/xwin/win.h3
-rw-r--r--hw/xwin/wincreatewnd.c6
-rw-r--r--hw/xwin/winprocarg.c6
-rw-r--r--hw/xwin/winvalargs.c2
-rw-r--r--hw/xwin/winwndproc.c2
7 files changed, 26 insertions, 10 deletions
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index a7773c5b8..111b3a8f2 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -716,6 +716,20 @@ OsVendorInit(void)
}
}
}
+
+ /* Work out what the default resize setting should be, and apply it if it
+ was not explicitly specified */
+ {
+ int j;
+ for (j = 0; j < g_iNumScreens; j++) {
+ if (g_ScreenInfo[j].iResizeMode == resizeDefault) {
+ if (g_ScreenInfo[j].fFullScreen)
+ g_ScreenInfo[j].iResizeMode = resizeNotAllowed;
+ else
+ g_ScreenInfo[j].iResizeMode = resizeWithRandr;
+ }
+ }
+ }
}
static void
diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man
index 5f2d2eabc..3d59f9b8e 100644
--- a/hw/xwin/man/XWin.man
+++ b/hw/xwin/man/XWin.man
@@ -124,7 +124,8 @@ Alternative name for \fB\-resize=scrollbars\fP.
.SH OPTIONS CONTROLLING RESIZE BEHAVIOUR
.TP 8
.B \-resize[=none|scrollbars|randr]
-Select the resize mode of an X screen. The default is randr.
+Select the resize mode of an X screen.
+The default is \fBnone\fP if \fB\-fullscreen\fP is used, \fBrandr\fP otherwise.
.RS
.IP \fB\-resize=none\fP 8
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 5c1ce32f1..c18c791f9 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -361,7 +361,8 @@ typedef struct {
* Resize modes
*/
typedef enum {
- notAllowed,
+ resizeDefault = -1,
+ resizeNotAllowed,
resizeWithScrollbars,
resizeWithRandr
} winResizeMode;
diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c
index 6732dcb58..8ce646181 100644
--- a/hw/xwin/wincreatewnd.c
+++ b/hw/xwin/wincreatewnd.c
@@ -183,7 +183,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
fForceShowWindow = TRUE;
}
dwWindowStyle |= WS_CAPTION;
- if (pScreenInfo->iResizeMode != notAllowed)
+ if (pScreenInfo->iResizeMode != resizeNotAllowed)
dwWindowStyle |= WS_THICKFRAME | WS_MAXIMIZEBOX;
}
else
@@ -238,7 +238,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
)
&& (pScreenInfo->iResizeMode == resizeWithScrollbars)) {
/* We cannot have scrollbars if we do not have a window border */
- pScreenInfo->iResizeMode = notAllowed;
+ pScreenInfo->iResizeMode = resizeNotAllowed;
}
/* Did the user specify a height and width? */
@@ -265,7 +265,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
#endif
/* Are we resizable */
- if (pScreenInfo->iResizeMode != notAllowed) {
+ if (pScreenInfo->iResizeMode != resizeNotAllowed) {
#if CYGDEBUG
winDebug
("winCreateBoundingWindowWindowed - Window is resizable\n");
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index 0a8337482..2c451ecbd 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -147,7 +147,7 @@ winInitializeScreenDefaults(void)
#endif
defaultScreenInfo.fMultipleMonitors = FALSE;
defaultScreenInfo.fLessPointer = FALSE;
- defaultScreenInfo.iResizeMode = resizeWithRandr;
+ defaultScreenInfo.iResizeMode = resizeDefault;
defaultScreenInfo.fNoTrayIcon = FALSE;
defaultScreenInfo.iE3BTimeout = WIN_E3B_DEFAULT;
defaultScreenInfo.fUseWinKillKey = WIN_DEFAULT_WIN_KILL;
@@ -672,7 +672,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
if (IS_OPTION("-resize"))
mode = resizeWithRandr;
else if (IS_OPTION("-noresize"))
- mode = notAllowed;
+ mode = resizeNotAllowed;
else if (strncmp(argv[i], "-resize=", strlen("-resize=")) == 0) {
char *option = argv[i] + strlen("-resize=");
@@ -681,7 +681,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
else if (strcmp(option, "scrollbars") == 0)
mode = resizeWithScrollbars;
else if (strcmp(option, "none") == 0)
- mode = notAllowed;
+ mode = resizeNotAllowed;
else {
ErrorF("ddxProcessArgument - resize - Invalid resize mode %s\n",
option);
diff --git a/hw/xwin/winvalargs.c b/hw/xwin/winvalargs.c
index edfd71f72..d0e0b7519 100644
--- a/hw/xwin/winvalargs.c
+++ b/hw/xwin/winvalargs.c
@@ -153,7 +153,7 @@ winValidateArgs(void)
/* Check for fullscreen and any non-fullscreen parameters */
if (g_ScreenInfo[i].fFullScreen
- && ((g_ScreenInfo[i].iResizeMode != notAllowed)
+ && ((g_ScreenInfo[i].iResizeMode != resizeNotAllowed)
|| !g_ScreenInfo[i].fDecoration
|| g_ScreenInfo[i].fLessPointer)) {
ErrorF("winValidateArgs - -fullscreen is invalid with "
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index ccea2aa77..1600efe05 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -334,7 +334,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
#endif
/* Break if we do not allow resizing */
- if ((s_pScreenInfo->iResizeMode == notAllowed)
+ if ((s_pScreenInfo->iResizeMode == resizeNotAllowed)
|| !s_pScreenInfo->fDecoration
#ifdef XWIN_MULTIWINDOWEXTWM
|| s_pScreenInfo->fMWExtWM