From b408baf2547882652cf8cfae6bbf8deacf0179b0 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 9 Jan 2024 17:24:27 +0100 Subject: [PATCH] impr: Make window management tools work better --- main/gui/source/window/win_window.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/gui/source/window/win_window.cpp b/main/gui/source/window/win_window.cpp index c7d67318b..4081cd62b 100644 --- a/main/gui/source/window/win_window.cpp +++ b/main/gui/source/window/win_window.cpp @@ -311,7 +311,6 @@ namespace hex { ::DwmSetWindowAttribute(hwnd, DWMWA_NCRENDERING_POLICY, &attribute, sizeof(attribute)); ::SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE); - ::SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) | WS_OVERLAPPEDWINDOW); } else { s_oldWndProc = ::SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)commonWindowProc); } @@ -389,6 +388,10 @@ namespace hex { void Window::beginNativeWindowFrame() { s_titleBarHeight = ImGui::GetCurrentWindowRead()->MenuBarHeight(); + + // Remove WS_POPUP style from the window to make various window management tools work + auto hwnd = glfwGetWin32Window(m_window); + ::SetWindowLong(hwnd, GWL_STYLE, (GetWindowLong(hwnd, GWL_STYLE) | WS_OVERLAPPEDWINDOW) & ~WS_POPUP); } void Window::endNativeWindowFrame() {