When using Wayland, the window is too big, it "jumps" when I start dragging it
mpv Information
mpv v0.40.0-dirty Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
libplacebo version: v7.349.0 (v7.349.0)
FFmpeg version: n8.0
FFmpeg library versions:
libavcodec 62.11.100
libavdevice 62.1.100
libavfilter 11.4.100
libavformat 62.3.100
libavutil 60.8.100
libswresample 6.1.100
libswscale 9.1.100
Other Information
- Linux version: Pop!_OS 24.04 LTS
- Kernel Version: 6.16.3-76061603-generic
- Window Manager and Version: COSMIC `cosmic-comp 0.1.0`
- Source of mpv: flatpak
Reproduction Steps
-
Play any video with a
voset to something that uses Wayland:- Happens with
gpu,gpu-next,dmabuf-wayland - Doesn't happen with
x11,xv,vaapi
- Happens with
-
Resize the window to be as large as possible (without maximizing) or use something like
autofit=90%. -
Try dragging it.
Expected Behavior
The window drags normally, i.e. same behavior as when not using Wayland or when the window is small (e.g. autofit=30%, actual cutoff seems to be at 62% for me).
Actual Behavior
The window initially "jumps" so that the top middle of the window is aligned with the mouse pointer. This is especially visible when using window dragging, but happens when dragging via the title bar as well.
This screencap doesn't capture the mouse pointer, but shows what happens when I start dragging from the bottom right corner:
Log File
Sample Files
No response
I carefully read all instruction and confirm that I did the following:
- [x] I tested with the latest mpv version to validate that the issue is not already fixed.
- [x] I provided all required information including system and mpv version.
- [x] 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. - [x] I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
- [x] I attached the full, untruncated log file.
- [x] I attached the backtrace in the case of a crash.
Should be upstream. We don't control the movement of the window at all during dragging. That's the compositor's job.
I'll report this to cosmic-comp in that case - do you know if there's any way in which mpv is different from (most) other Wayland apps though? I wasn't able to repro this with any other app.
By default we preserve aspect ratios when resizing. Maybe that confuses cosmic. Do you get this issue if you resize while using --no-keepaspect?
--no-keepaspect prevents the jump from happening 👍
Edit: I also noticed that --autofit (as well as --geometry) stop working past a certain maximum, i.e. --autofit=70% results in the same size as --autofit=90%. This may be related - it seems that resizing the window past this maximum (whatever it is) correlates with the issue happening.
Closing per https://github.com/pop-os/cosmic-comp/issues/1819#issuecomment-3662752505 implying this is a cosmic-comp bug.