From 5bc37c4aade6ac7640d7e6357eb6ab4011488e29 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 15 Jan 2024 10:27:50 +0100 Subject: [PATCH] GL: added noresizable option This option is (besides the obvious use-case) particularly useful when window is bigger than active display resolution, in which case GLFW tend to resize the window to fit the screen, which may not be always desired. --- src/video_display/gl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video_display/gl.cpp b/src/video_display/gl.cpp index b6a729f46..4f45137c0 100644 --- a/src/video_display/gl.cpp +++ b/src/video_display/gl.cpp @@ -530,6 +530,7 @@ static void gl_show_help(bool full) { << "\t\t\tsyntax: " TBOLD("[x][{+-}[{+-}]]") << (full ? " [1]" : "") << "\n"; col() << TBOLD("\tfixed_size") << "\tdo not resize window on new stream\n"; + col() << TBOLD("\tnoresizable") << "\twindow won't be resizable (useful with size=)\n"; #ifdef SPOUT col() << TBOLD("\tspout") << "\t\tuse Spout (optionally with name)\n"; #endif @@ -678,6 +679,8 @@ static void *display_gl_parse_fmt(struct state_gl *s, char *ptr) { } } else if (strcmp(tok, "fixed_size") == 0) { s->fixed_size = true; + } else if (strcmp(tok, "noresizable") == 0) { + s->hints[GLFW_RESIZABLE] = GLFW_FALSE; } else { log_msg(LOG_LEVEL_ERROR, MOD_NAME "Unknown option: %s\n", tok); return nullptr;