Skip to content

Commit

Permalink
win32: adjust WM_NCACTIVATE for better compatibility with window state
Browse files Browse the repository at this point in the history
We have to support all changing states, not only borderless.
  • Loading branch information
kasper93 authored and Dudemanguy committed Oct 2, 2023
1 parent 47dec1c commit 01c5346
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions video/out/w32_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ static DWORD update_style(struct vo_w32_state *w32, DWORD style)
{
const DWORD NO_FRAME = WS_OVERLAPPED | WS_MINIMIZEBOX | WS_THICKFRAME;
const DWORD FRAME = WS_OVERLAPPEDWINDOW;
const DWORD FULLSCREEN = NO_FRAME;
const DWORD FULLSCREEN = NO_FRAME & ~WS_THICKFRAME;
style &= ~(NO_FRAME | FRAME | FULLSCREEN);
style |= WS_SYSMENU;
if (w32->current_fs) {
Expand Down Expand Up @@ -1287,7 +1287,9 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
break;
case WM_NCACTIVATE:
// Cosmetic to remove blinking window border when initializing window
return 1;
if (!w32->opts->border)
lParam = -1;
break;
case WM_NCHITTEST:
// Provide sizing handles for borderless windows
if ((!w32->opts->border || !w32->opts->title_bar) && !w32->current_fs) {
Expand Down

0 comments on commit 01c5346

Please sign in to comment.