Using any of the `autofit` options from the mpv console positions the window to the top left instead of center
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 37k
- Forks
- 3.5k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 22
Description
mpv Information
mpv v0.40.0-131-ga418d2163 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
built on Jun 7 2025 00:15:41
libplacebo version: v7.351.0 (v7.351.0-dirty)
FFmpeg version: N-119853-g869e288b3
FFmpeg library versions:
libavcodec 62.3.101
libavdevice 62.0.100
libavfilter 11.0.100
libavformat 62.0.102
libavutil 60.3.100
libswresample 6.0.100
libswscale 9.0.100
Other Information
- Windows version: Windows 10 Pro 64-bit
- GPU model, driver and version: NVIDIA GeForce RTX 3060 Ti, driver ver. 576.52
- Source of mpv: shinchiro
- Latest known working version: Don't know
- Issue started after the following happened: Don't know
Reproduction Steps
- Open video file with mpv.
- Open console with
`. - Enter
set autofit 100%x90%.
Expected Behavior
Calling set autofit 100%x90% (or autofit variants like autofit-larger and autofit-smaller) should resize the height to 90% if the video height is greater than that and position the window to the center of the previous window position.
Actual Behavior
Calling set autofit 100%x90% (or autofit variants like autofit-larger and autofit-smaller) resizes the height to 90% if the video height is greater than that and positions the window to the top-left of the previous window position.
Here's an example of why this is an issue:
I have in my mpv.conf
[landscape]
profile-cond=width>height
autofit-larger=100%x90%
[portrait]
profile-cond=width<=height
autofit-larger=100%x100%
Basically if a video is landscape, set the max window height to 90% of the screen. If it is portrait, let it display its full width and height.
When I play a video and go to fullscreen mode, once I play the next file in the folder (same resolution), then un-fullscreen, the window is suddenly in the top-left of the screen instead of where the mpv window previously was (usually center).
Log File
Sample Files
No response
I carefully read all instruction and confirm that I did the following:
- I tested with the latest mpv version to validate that the issue is not already fixed.
- I provided all required information including system and mpv version.
- I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of
--log-file=output.txt. - I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
- I attached the full, untruncated log file.
- I attached the backtrace in the case of a crash.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue from the mpv console by opening a video and setting autofit to 100%x90%, then trace the resize and window-position handling used by the autofit, autofit-larger, and autofit-smaller options. Done means resizing from the console preserves the previous window's centered position instead of moving it to the top-left, including the fullscreen and next-file scenario.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100