diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2021-04-17 15:57:14 +0300 |
---|---|---|
committer | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2021-04-23 10:45:51 +0300 |
commit | 954f6ac7bfd68ddfff7d89fe0ec6319710fa5940 (patch) | |
tree | db86458c5633fc88051ea693a9173afee385bbfa /video/out/w32_common.c | |
parent | e00ae12bbb2ddb448a6241a73df77978fff8e60a (diff) | |
download | mpv-954f6ac7bfd68ddfff7d89fe0ec6319710fa5940.tar.bz2 mpv-954f6ac7bfd68ddfff7d89fe0ec6319710fa5940.tar.xz |
win32: fit_window_on_screen: centralize logic (no-op)
fit_on_screen is called only from reinit_window_state.
Move the yes/no logic unmodified from fit_on_screen to
reinit_window_state, and remove the w32->parent condition because it's
already checked earlier at reinit_window_state.
Diffstat (limited to 'video/out/w32_common.c')
-rw-r--r-- | video/out/w32_common.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 5a52006307..1a84e0de55 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -824,9 +824,6 @@ static bool fit_rect_size(RECT *rc, long n_w, long n_h) // Also, if the top edge is above the working area, move down to align. static void fit_window_on_screen(struct vo_w32_state *w32) { - if (w32->parent || w32->current_fs || IsMaximized(w32->window)) - return; - RECT screen = get_working_area(w32); if (w32->opts->border) subtract_window_borders(w32, w32->window, &screen); @@ -986,7 +983,9 @@ static void reinit_window_state(struct vo_w32_state *w32) // Assume that the window has already been fit on screen before switching fs if (!toggle_fs || w32->fit_on_screen) { - fit_window_on_screen(w32); + if (!w32->current_fs && !IsMaximized(w32->window)) + fit_window_on_screen(w32); + // The fullscreen state might still be active, so set the flag // to fit on screen next time the window leaves the fullscreen. w32->fit_on_screen = w32->current_fs; |