From a3572b218897de211836bb52fd220587dc44d931 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 28 Nov 2017 19:48:40 +1100 Subject: [PATCH] [client] added option to prevent window resize --- client/main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/client/main.c b/client/main.c index f94b798b..6b048677 100644 --- a/client/main.c +++ b/client/main.c @@ -56,6 +56,7 @@ struct AppState struct AppParams { bool autoResize; + bool allowResize; bool keepAspect; bool borderless; bool center; @@ -73,6 +74,7 @@ struct AppState state; struct AppParams params = { .autoResize = false, + .allowResize = true, .keepAspect = true, .borderless = false, .center = true, @@ -642,8 +644,8 @@ int run() params.h, ( SDL_WINDOW_SHOWN | - (!params.autoResize ? SDL_WINDOW_RESIZABLE : 0) | - ( params.borderless ? SDL_WINDOW_BORDERLESS : 0) + (params.allowResize ? SDL_WINDOW_RESIZABLE : 0) | + (params.borderless ? SDL_WINDOW_BORDERLESS : 0) ) ); @@ -794,6 +796,7 @@ void doHelp(char * app) " -m Disable mipmapping\n" "\n" " -a Auto resize the window to the guest\n" + " -n Don't allow the window to resize\n" " -r Don't maintain the aspect ratio\n" " -d Borderless mode\n" " -x XPOS Initial window X position [current: %s]\n" @@ -841,7 +844,7 @@ void doLicense() int main(int argc, char * argv[]) { int c; - while((c = getopt(argc, argv, "hf:sc:p:gmardx:y:w:b:l")) != -1) + while((c = getopt(argc, argv, "hf:sc:p:gmanrdx:y:w:b:l")) != -1) switch(c) { case '?': @@ -878,6 +881,10 @@ int main(int argc, char * argv[]) params.autoResize = true; break; + case 'n': + params.allowResize = false; + break; + case 'r': params.keepAspect = false; break;