From d40ee0ea9397ad44415c5da9f95747e4e7fe6c5c Mon Sep 17 00:00:00 2001 From: damywise Date: Thu, 24 Mar 2022 16:13:58 +0700 Subject: [PATCH] Fix overflow on fullscreen and maximize --- windows/window_manager_plugin.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/windows/window_manager_plugin.cpp b/windows/window_manager_plugin.cpp index 5189cff5..8e112a8b 100644 --- a/windows/window_manager_plugin.cpp +++ b/windows/window_manager_plugin.cpp @@ -109,9 +109,21 @@ std::optional WindowManagerPlugin::HandleWindowProc(HWND hWnd, std::optional result = std::nullopt; if (message == WM_NCCALCSIZE) { + if (wParam && window_manager->IsFullScreen()) { + NCCALCSIZE_PARAMS* sz = reinterpret_cast(lParam); + sz->rgrc[0].bottom -= 3; + return (WVR_HREDRAW | WVR_VREDRAW); + } + if (wParam && window_manager->is_frameless_) { SetWindowLong(hWnd, 0, 0); NCCALCSIZE_PARAMS* sz = reinterpret_cast(lParam); + if (window_manager->IsMaximized()) { + sz->rgrc[0].left += 8; + sz->rgrc[0].top += 8; + sz->rgrc[0].right -= 8; + sz->rgrc[0].bottom -= 9; + } sz->rgrc[0].bottom += 1; return (WVR_HREDRAW | WVR_VREDRAW); }