Skip to content

Commit

Permalink
win32: set window_corners to default for fullscreen
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kasper93 committed Sep 21, 2023
1 parent 5a15895 commit a549630
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions video/out/w32_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,13 +1043,23 @@ 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)
return;

// 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).
Expand Down Expand Up @@ -1092,12 +1102,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)
{
Expand Down

0 comments on commit a549630

Please sign in to comment.