[Wayland] keepaspect-window resizes past xdg_toplevel configure_bounds on snap/tile, hiding the OSC under the taskbar
mpv Information
mpv v0.41.0 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
built on Aug 29 2026 22:02:52
libplacebo version: v7.360.1
FFmpeg version: n9.0.1 (runtime n9.0.2)
FFmpeg library versions:
libavcodec 63.1.101 (runtime 63.1.102)
libavdevice 63.1.101 (runtime 63.1.102)
libavfilter 12.1.101 (runtime 12.1.102)
libavformat 63.1.101 (runtime 63.1.102)
libavutil 61.1.101 (runtime 61.1.102)
libswresample 7.1.101 (runtime 7.1.102)
libswscale 10.1.101 (runtime 10.1.102)Other Information
- Linux version: CachyOS (Arch-based, rolling)
- Kernel Version: Linux 7.2.8-1-cachyos x86_64
- GPU Model: AMD Navi 31 [Radeon RX 7900 XT/7900 XTX/7900 GRE/7900M] (03:00.0), iGPU Granite Ridge also present (75:00.0)
- Mesa/GPU Driver Version: mesa 3:26.2.3-1
- Window Manager and Version: KWin 6.7.5, Plasma 6.7.5 Wayland session, single 5120x1440 output, scale 1, HDR enabled, bottom panel (maximized-window area 5120x1400)
- Source of mpv: Arch/CachyOS package,
mpv 1:0.41.0-6.1(v0.41.0 release, latest) - Latest known working version: unknown, no older version tested
- Issue started after the following happened: nothing I can pin. It is not a regression I noticed; it reproduces on stock defaults (
--no-config) and I only learned the mechanism while investigating.
Reproduction Steps
- Run with defaults:
mpv --no-config av://lavfi:testsrc=size=1920x1080 - Hold Shift and drag the window by its titlebar into a KWin custom tiling zone (Plasma 6 tiling layouts). On this display the zones are full-height halves, so dropping at the right screen edge snaps it into the right zone. The equivalent scriptable trigger is invoking the KWin shortcut
Window Custom Quick Tile Right(kglobalaccelinvokeShortcut). - mpv then resizes itself to a 16:9 client of
2554x1437, which is 65 px taller than the maximum size KWin advertised and 29 px taller than the screen is tall, so the bottom of the window (where the OSC lives) is off-screen.
Notes:
- The same action without Shift (plain drag-to-screen-edge quick tile) does not reproduce: it ends up
client=2560x1372, i.e. inside the advertised bounds. Only the custom tiling zone path overshoots. - It needs the tile width x video aspect to exceed the available height — here a 16:9 video snapped into a full-height half-width zone (2560 wide) on a 1440-tall screen whose work area is shorter than 2560 * 9/16 = 1440. For a 2.40:1 source the same snap ends up with the window smaller than the zone instead, so the effect is source/tile-shape dependent.
- Reproduces without any user config (
--no-config, default--keepaspect-window=yes), and with a real 1920x1080 H.264 file as well as lavfi testsrc.
Expected Behavior
The snapped window should stay within what the compositor allows (2554x1364, inside the advertised configure_bounds), with the OSC fully visible inside the work area. --keepaspect-window=no gives exactly that.
Actual Behavior
mpv acks the compositor's configure, then commits its own aspect-corrected (larger) surface. WAYLAND_DEBUG trace for the snap:
xdg_toplevel#36.configure_bounds(5120, 1372) # KWin: content must not exceed 1372 tall
...
xdg_toplevel#36.configure(2554, 1364, array[4]) # KWin: tile request
xdg_surface#35.ack_configure(33389) # mpv acks it
# mpv then commits a 2554x1437 surface; KWin reports clientGeometry 2554x1437, tile=KWin::CustomTileSo the resulting client rect is 65 px taller than configure_bounds and 29 px taller than the screen; the OSC's lower row (seek bar, time, audio/subtitle/volume/fullscreen buttons) is below the screen edge under the taskbar and unreachable, leaving only the OSC's top row (title/left buttons) visible. A screenshot showing this will be added as a comment.
With --keepaspect-window=no the client stays at 2554x1364 (inside bounds, OSC fully visible), so the aspect lock applied to this compositor-driven resize is what pushes it out.
In video/out/wayland_common.c (v0.41.0), handle_toplevel_config() calls apply_keepaspect(wl, &width, &height) and recomputes the compositor's width/height, while configure_bounds is only consulted in set_window_bounds() (used for mpv's own size requests). Reporter's code-reading observation only; I don't know what the intended fix is.
Log File
Full log (295 KB), made with --gpu-debug --log-file=output.txt and the same parameters as above, captured while the behavior was happening:
https://gist.github.com/Nullpntr1337/96eb094daa29b482f088fc7037c1ebb9
The issue was opened with the GitHub CLI, which cannot upload attachments; the file is linked in the meantime. Reproduces with av://lavfi:testsrc=size=1920x1080, so no sample file is needed. The full WAYLAND_DEBUG trace is available on request.
Sample Files
Not needed — reproducible with av://lavfi:testsrc=size=1920x1080.
I carefully read all instruction and confirm that I did the following:
- I tested and confirmed that the issue exists with the latest release version (v0.41.0) or newer.
- 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 provided the full, untruncated log file (linked; CLI cannot attach files).
- No crash, so no backtrace.
Source: mpv-player/mpv