1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-01 23:00:41 +00:00

win32: adjust WM_NCACTIVATE for better compatibility with window state

We have to support all changing states, not only borderless.
This commit is contained in:
Kacper Michajłow 2023-10-02 20:10:28 +02:00 committed by Dudemanguy
parent 47dec1c7c2
commit 01c5346d1a

View File

@ -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 NO_FRAME = WS_OVERLAPPED | WS_MINIMIZEBOX | WS_THICKFRAME;
const DWORD FRAME = WS_OVERLAPPEDWINDOW; const DWORD FRAME = WS_OVERLAPPEDWINDOW;
const DWORD FULLSCREEN = NO_FRAME; const DWORD FULLSCREEN = NO_FRAME & ~WS_THICKFRAME;
style &= ~(NO_FRAME | FRAME | FULLSCREEN); style &= ~(NO_FRAME | FRAME | FULLSCREEN);
style |= WS_SYSMENU; style |= WS_SYSMENU;
if (w32->current_fs) { if (w32->current_fs) {
@ -1287,7 +1287,9 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
break; break;
case WM_NCACTIVATE: case WM_NCACTIVATE:
// Cosmetic to remove blinking window border when initializing window // Cosmetic to remove blinking window border when initializing window
return 1; if (!w32->opts->border)
lParam = -1;
break;
case WM_NCHITTEST: case WM_NCHITTEST:
// Provide sizing handles for borderless windows // Provide sizing handles for borderless windows
if ((!w32->opts->border || !w32->opts->title_bar) && !w32->current_fs) { if ((!w32->opts->border || !w32->opts->title_bar) && !w32->current_fs) {