From 3c328d93b5af1d85d28c0be7589ee33efb48d852 Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Mon, 12 Apr 2021 01:45:23 +0300 Subject: [PATCH] win_opengl: fix resizing as child window --- src/win/win_opengl.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/win/win_opengl.c b/src/win/win_opengl.c index 4b781cb58..292e55fb0 100644 --- a/src/win/win_opengl.c +++ b/src/win/win_opengl.c @@ -379,16 +379,12 @@ static void opengl_main() } else if (sync_event == sync_objects.resize) { - /* Detach from parent while resizing */ - set_parent_binding(0); - SDL_SetWindowSize(window, resize_info.width, resize_info.height); - glViewport(0, 0, resize_info.width, resize_info.height); + /* SWP_NOZORDER is needed for child window and SDL doesn't enable it. */ + SetWindowPos(wmi.info.win.window, parent, 0, 0, resize_info.width, resize_info.height, SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOACTIVATE); - set_parent_binding(1); - - //SetForegroundWindow(GetParent(parent)); + glViewport(0, 0, resize_info.width, resize_info.height); } }