@@ -85,12 +85,7 @@ std::optional<LRESULT> WindowManagerPlugin::HandleWindowProc(HWND hWnd, UINT mes
8585{
8686 std::optional<LRESULT> result = std::nullopt ;
8787
88- if (message == WM_NCPAINT)
89- {
90- if (window_manager->title_bar_style == " hidden" )
91- return 1 ;
92- }
93- else if (message == WM_NCCALCSIZE)
88+ if (message == WM_NCCALCSIZE)
9489 {
9590 if (wParam && window_manager->is_frameless )
9691 {
@@ -105,18 +100,25 @@ std::optional<LRESULT> WindowManagerPlugin::HandleWindowProc(HWND hWnd, UINT mes
105100 GetWindowPlacement (hWnd, &wPos);
106101 RECT borderThickness;
107102 SetRectEmpty (&borderThickness);
108- AdjustWindowRectEx (&borderThickness, GetWindowLongPtr (hWnd, GWL_STYLE) & ~WS_CAPTION, FALSE , NULL );
103+ AdjustWindowRectEx (&borderThickness, GetWindowLongPtr (hWnd, GWL_STYLE) & ~WS_CAPTION & WS_BORDER , FALSE , NULL );
109104 NCCALCSIZE_PARAMS *sz = reinterpret_cast <NCCALCSIZE_PARAMS *>(lParam);
105+
106+ bool isResizable = window_manager->IsResizable ();
110107 // Add 1 pixel to the top border to make the window resizable from the top border
111- sz->rgrc [0 ].top += 1 ;
112- sz->rgrc [0 ].right -= borderThickness. right ;
113- sz->rgrc [0 ].bottom -= borderThickness. bottom ;
114- sz->rgrc [0 ].left -= borderThickness. left ;
108+ sz->rgrc [0 ].top += isResizable ? 1 : 0 ;
109+ sz->rgrc [0 ].right -= isResizable ? 7 : 0 ;
110+ sz->rgrc [0 ].bottom -= isResizable ? 7 : 0 ;
111+ sz->rgrc [0 ].left += isResizable ? 7 : 0 ;
115112
116113 return (WVR_HREDRAW | WVR_VREDRAW);
117114 }
118115 }
119- else if (message == WM_NCHITTEST)
116+ if (message == WM_NCPAINT)
117+ {
118+ if (window_manager->title_bar_style == " hidden" )
119+ return 1 ;
120+ }
121+ else if (message == WM_NCHITTEST)
120122 {
121123 LONG width = 10 ;
122124 POINT mouse = {LOWORD (lParam), HIWORD (lParam)};
0 commit comments