@@ -245,26 +245,25 @@ LRESULT WINAPI WndProcHook(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
245
245
switch (msg) {
246
246
case WM_NCCALCSIZE: {
247
247
if (wParam && g_ClientIsBorderless) {
248
- WINDOWPLACEMENT placement = {0 };
249
- if (::GetWindowPlacement (hWnd, &placement))
250
- {
251
- if (placement.showCmd == SW_MAXIMIZE)
252
- {
253
- NCCALCSIZE_PARAMS* params = (NCCALCSIZE_PARAMS*)lParam;
248
+ NCCALCSIZE_PARAMS* params = (NCCALCSIZE_PARAMS*)lParam;
249
+ if (IsMaximized (hWnd)) {
254
250
255
- HMONITOR monitor = MonitorFromWindow (hWnd, MONITOR_DEFAULTTONULL);
256
- if (!monitor) return 0 ;
251
+ HMONITOR monitor = MonitorFromWindow (hWnd, MONITOR_DEFAULTTONULL);
252
+ if (!monitor) return 0 ;
257
253
258
- MONITORINFO monitor_info = {0 };
259
- monitor_info.cbSize = sizeof (monitor_info);
260
- if (!GetMonitorInfo (monitor, &monitor_info)) return 0 ;
254
+ MONITORINFO monitor_info = {0 };
255
+ monitor_info.cbSize = sizeof (monitor_info);
256
+ if (!GetMonitorInfo (monitor, &monitor_info)) return 0 ;
261
257
262
- // when maximized, make the client area fill just the monitor (without task bar) rect,
263
- // not the whole window rect which extends beyond the monitor.
264
- params->rgrc [0 ] = monitor_info.rcWork ;
265
- }
258
+ // when maximized, make the client area fill just the monitor (without task bar) rect,
259
+ // not the whole window rect which extends beyond the monitor.
260
+ params->rgrc [0 ] = monitor_info.rcWork ;
261
+ return 0 ;
262
+ }
263
+ else {
264
+ params->rgrc [0 ].bottom += 1 ;
265
+ return WVR_VALIDRECTS;
266
266
}
267
- return 0 ;
268
267
}
269
268
break ;
270
269
}
@@ -328,8 +327,10 @@ LRESULT WINAPI WndProcHook(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
328
327
break ;
329
328
}
330
329
case WM_TIMER: {
331
- if (g_ClientRenderFunction) // Ensure this is the root hWnd
330
+ if (g_ClientRenderFunction) {
332
331
g_ClientRenderFunction (hWnd);
332
+ DwmFlush ();
333
+ }
333
334
return 1 ;
334
335
}
335
336
case WM_ERASEBKGND: // Prevent flicker when we're rendering during resize
0 commit comments