From eb89de82b566ea6ad091079e98b2cd977d0a017c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Tue, 22 Aug 2023 00:57:06 +0200 Subject: [PATCH] win32: set window_corners to default for fullscreen I don't think in fullscreen mode it makes sense to enable rounded corners. We can add another option if someone needs it, but for now `window_corners` affects only the window as one would expect. --- video/out/w32_common.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 18a664aa35c38..88db188a5b32f 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -1045,6 +1045,15 @@ static void update_window_state(struct vo_w32_state *w32) signal_events(w32, VO_EVENT_RESIZE); } +static void update_corners_pref(const struct vo_w32_state *w32) { + if (w32->parent) + return; + + int pref = w32->current_fs ? 0 : w32->opts->window_corners; + DwmSetWindowAttribute(w32->window, DWMWA_WINDOW_CORNER_PREFERENCE, + &pref, sizeof(pref)); +} + static void reinit_window_state(struct vo_w32_state *w32) { if (w32->parent) @@ -1052,6 +1061,7 @@ static void reinit_window_state(struct vo_w32_state *w32) // The order matters: fs state should be updated prior to changing styles update_fullscreen_state(w32); + update_corners_pref(w32); update_window_style(w32); // fit_on_screen is applied at most once when/if applicable (normal win). @@ -1094,12 +1104,6 @@ static void update_dark_mode(const struct vo_w32_state *w32) &use_dark_mode, sizeof(use_dark_mode)); } -static void update_corners_pref(const struct vo_w32_state *w32) { - DwmSetWindowAttribute(w32->window, DWMWA_WINDOW_CORNER_PREFERENCE, - &w32->opts->window_corners, - sizeof(w32->opts->window_corners)); -} - static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {