summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2014-11-11 11:46:25 +0000
committerJon Turney <jon.turney@dronecode.org.uk>2016-06-23 14:15:27 +0100
commite1b983b55e4cefcf976c8f92d608af8216a56927 (patch)
treec154f18d8b3a200511f8f7e900c16dad93658b2d /hw
parent42f7cd5d92f2046e1b5c264b3d76c3afda624a55 (diff)
hw/xwin: Default to -noresize when -fullscreen is used
Currently, just using -fullscreen fails in winValidateArgs(), as the default -resize=randr is incompatible with -fullscreen. Set the default resize mode to -noresize if -fullscreen is used. Also, rename enum value notAllowed -> resizeNotAllowed for clarity. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
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 07631a9e1..462101262 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -690,6 +690,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 7ffdd6c23..2222293e0 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 f9c44b3b3..787c42a96 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -335,7 +335,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 b2f797c51..e6e587f9f 100644
--- a/hw/xwin/wincreatewnd.c
+++ b/hw/xwin/wincreatewnd.c
@@ -171,7 +171,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
fForceShowWindow = TRUE;
}
dwWindowStyle |= WS_CAPTION;
- if (pScreenInfo->iResizeMode != notAllowed)
+ if (pScreenInfo->iResizeMode != resizeNotAllowed)
dwWindowStyle |= WS_THICKFRAME | WS_MAXIMIZEBOX;
}
else
@@ -226,7 +226,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? */
@@ -253,7 +253,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 8e09c7029..35ea8f23a 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -140,7 +140,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;
@@ -662,7 +662,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=");
@@ -671,7 +671,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 742364372..3df22927d 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -316,7 +316,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