1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 17:12:36 +00:00

player: always notify when writing window-scale option

As described in the previous commit, update_window_scale will always
execute whenever window-scale is written even if the value doesn't
change.
This commit is contained in:
Dudemanguy 2024-02-25 14:10:00 -06:00
parent bc28f7693d
commit bd1bcc1f31
4 changed files with 11 additions and 33 deletions

View File

@ -2690,30 +2690,6 @@ Property list
enabled, or after precise seeking). Files with imprecise timestamps (such
as Matroska) might lead to unstable results.
``window-scale`` (RW)
Window size multiplier. Setting this will resize the video window to the
values contained in ``dwidth`` and ``dheight`` multiplied with the value
set with this property. Setting ``1`` will resize to original video size
(or to be exact, the size the video filters output). ``2`` will set the
double size, ``0.5`` halves the size.
Note that setting a value identical to its previous value will not resize
the window. That's because this property mirrors the ``window-scale``
option, and setting an option to its previous value is ignored. If this
value is set while the window is in a fullscreen, the multiplier is not
applied until the window is taken out of that state. Writing this property
to a maximized window can unmaximize the window depending on the OS and
window manager. If the window does not unmaximize, the multiplier will be
applied if the user unmaximizes the window later.
See ``current-window-scale`` for the value derived from the actual window
size.
Since mpv 0.31.0, this always returns the previously set value (or the
default value), instead of the value implied by the actual window size.
Before mpv 0.31.0, this returned what ``current-window-scale`` returns now,
after the window was created.
``current-window-scale`` (RW)
The ``window-scale`` value calculated from the current window size. This
has the same value as ``window-scale`` if the window size was not changed
@ -2722,10 +2698,9 @@ Property list
calculated from the last non-fullscreen size of the window. The property
is unavailable if no video is active.
When setting this property in the fullscreen or maximized state, the behavior
is the same as window-scale. In all other cases, setting the value of this
property will always resize the window. This does not affect the value of
``window-scale``.
It is also possible to write to this property. This has the same behavior as
writing ``window-scale``. Note that writing to ``current-window-scale`` will
not affect the value of ``window-scale``.
``focused``
Whether the window has focus. Might not be supported by all VOs.

View File

@ -3397,7 +3397,10 @@ Window
``--window-scale=<factor>``
Resize the video window to a multiple (or fraction) of the video size. This
option is applied before ``--autofit`` and other options are applied (so
they override this option).
they override this option). Changing this option while the window is
maximized can unmaximize the window depending on the OS and window manager.
If the window does not unmaximize, the multiplier will be applied if the user
unmaximizes the window later.
For example, ``--window-scale=0.5`` would show the window at half the
video size.

View File

@ -117,9 +117,9 @@
#6 add gamma 1
#7 add saturation -1
#8 add saturation 1
#Alt+0 set current-window-scale 0.5 # halve the window size
#Alt+1 set current-window-scale 1.0 # reset the window size
#Alt+2 set current-window-scale 2.0 # double the window size
#Alt+0 set window-scale 0.5 # halve the window size
#Alt+1 set window-scale 1.0 # reset the window size
#Alt+2 set window-scale 2.0 # double the window size
#b cycle deband # toggle the debanding filter
#d cycle deinterlace # cycle the deinterlacing filter
#r add sub-pos -1 # move subtitles up

View File

@ -128,7 +128,7 @@ static const m_option_t mp_vo_opt_list[] = {
{"autofit-larger", OPT_SIZE_BOX(autofit_larger)},
{"autofit-smaller", OPT_SIZE_BOX(autofit_smaller)},
{"auto-window-resize", OPT_BOOL(auto_window_resize)},
{"window-scale", OPT_DOUBLE(window_scale), M_RANGE(0.001, 100)},
{"window-scale", OPT_DOUBLE(window_scale), M_RANGE(0.001, 100), .force_update = true},
{"window-minimized", OPT_BOOL(window_minimized)},
{"window-maximized", OPT_BOOL(window_maximized)},
{"focus-on-open", OPT_REMOVED("Replaced by --focus-on")},