From a968caf1d207023b2820cf4c31ae3e7324ffb218 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 12 Sep 2020 15:38:50 +0200 Subject: [PATCH] windisplay: Fix parented window receiving WS_POPUP style Fixes #915 --- panda/src/windisplay/winGraphicsWindow.cxx | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index c2e39d592e..372cfafede 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -973,17 +973,25 @@ make_style(const WindowProperties &properties) { // Additionally, the window class attribute should not include the // CS_PARENTDC style. - DWORD window_style = WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; + DWORD window_style = WS_CLIPCHILDREN | WS_CLIPSIBLINGS; if (properties.get_fullscreen()) { - window_style |= WS_SYSMENU; - } else if (!properties.get_undecorated()) { - window_style |= (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX); - - if (!properties.get_fixed_size()) { - window_style |= (WS_SIZEBOX | WS_MAXIMIZEBOX); + window_style |= WS_POPUP | WS_SYSMENU; + } else { + if (_parent_window_handle) { + window_style |= WS_CHILD; } else { - window_style |= WS_BORDER; + window_style |= WS_POPUP; + } + + if (!properties.get_undecorated()) { + window_style |= (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX); + + if (!properties.get_fixed_size()) { + window_style |= (WS_SIZEBOX | WS_MAXIMIZEBOX); + } else { + window_style |= WS_BORDER; + } } } return window_style;