summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2021-04-17 13:18:43 +0300
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2021-04-23 10:45:51 +0300
commitef1d0b2cdb43121f0138dfb39f516aee9d7314ad (patch)
tree359fb39fe5ee5e5445f13b0fc091b5f1ebc134b1
parentf665149fc889724ab011b6839f17568b1e9c69d0 (diff)
downloadmpv-ef1d0b2cdb43121f0138dfb39f516aee9d7314ad.tar.bz2
mpv-ef1d0b2cdb43121f0138dfb39f516aee9d7314ad.tar.xz
options: win32: ignore and deprecate --fit-border
The accurate description of this option was: - fit-border is enabled by default. When disabled, it adds a bug where if the window has borders and mpv shrinks it to fit the desktop, then the calculation ignores the borders and adds incorrect video crop. The option was added at commits 70f64f3c and 949247d6, in order to solve an issue (#2935) where if mpv wanted to display a video with size WxH, then w32_common.c incorrectly set the window to WxH, while down-scaling the video slightly to fit (even with small sizes). It was addressed with a new option which is enabled by default, but does the right thing (sets the client area to WxH) only when disabled, so that everyone who prefers their video slightly downscaled could keep their default behavior. (#2935 also addressed an off-by-one issue, fixed before fit-border) While disabling the option did avoid unnecessary downscaling, it also added a bug when disabled: the borders are no longer taken into account when the size is too big for the desktop. Most users don't notice and are unaffected as it's enabled by default. Shortly later (981048e0) the core issue is fixed, and now the client area is correctly set to WxH instead of the window (and together with the three following commits which center the video, adds a new bug where the window title can be outside the display - addressed next). However, fit-border remained, now without any effect, except that it still has the same bug when disabled and the window is too big. Later code changes and refactoring preserved this issue with great attention to details, and it remained in identical form until now. Simply rip out fit-border.
-rw-r--r--DOCS/man/options.rst6
-rw-r--r--options/options.c3
-rw-r--r--video/out/w32_common.c2
3 files changed, 3 insertions, 8 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index 14e58b28e5..9e30ea0f75 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -2995,12 +2995,6 @@ Window
Play video with window border and decorations. Since this is on by
default, use ``--no-border`` to disable the standard window decorations.
-``--fit-border``, ``--no-fit-border``
- (Windows only) Fit the whole window with border and decorations on the
- screen. Since this is on by default, use ``--no-fit-border`` to make mpv
- try to only fit client area with video on the screen. This behavior only
- applied to window/video with size exceeding size of the screen.
-
``--on-all-workspaces``
(X11 and macOS only)
Show the video window on all virtual desktops.
diff --git a/options/options.c b/options/options.c
index 2a168da4e5..45ba410fc9 100644
--- a/options/options.c
+++ b/options/options.c
@@ -113,7 +113,8 @@ static const m_option_t mp_vo_opt_list[] = {
{"ontop-level", OPT_CHOICE(ontop_level, {"window", -1}, {"system", -2},
{"desktop", -3}), M_RANGE(0, INT_MAX)},
{"border", OPT_FLAG(border)},
- {"fit-border", OPT_FLAG(fit_border)},
+ {"fit-border", OPT_FLAG(fit_border),
+ .deprecation_message = "the option is ignored and no longer needed"},
{"on-all-workspaces", OPT_FLAG(all_workspaces)},
{"geometry", OPT_GEOMETRY(geometry)},
{"autofit", OPT_SIZE_BOX(autofit)},
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index f9778549c6..0f5f7a5370 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -828,7 +828,7 @@ static void fit_window_on_screen(struct vo_w32_state *w32)
return;
RECT screen = get_working_area(w32);
- if (w32->opts->border && w32->opts->fit_border)
+ if (w32->opts->border)
subtract_window_borders(w32, w32->window, &screen);
if (fit_rect(&w32->windowrc, &screen)) {