mpv keeps exiting fullscreen after running skip-intro.lua script
Important Information
- mpv version
mpv v0.37.0-352-g531704e35d Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
built on Feb 22 2024 02:29:27
libplacebo version: v6.338.2
FFmpeg version: n6.1.1
FFmpeg library versions:
libavutil 58.29.100
libavcodec 60.31.102
libavformat 60.16.100
libswscale 7.5.100
libavfilter 9.12.100
libswresample 4.12.100
- Linux Distribution and Version
- OS: Arch Linux
- Kernel: 6.7.5-arch1-1
- Source of the mpv binary
- Installed mpv via
parufrom the aur packagempv-git
- Installed mpv via
- If known which version of mpv introduced the problem
- Within the last week, maybe this is relevant? https://github.com/mpv-player/mpv/pull/13482
Fix this by unmaximize the window
- Window Manager and version
Hyprland, built from branch main at commit ea3fd13e24d7d3a74cf803bef3e6133b5d708d1b dirty (shadow: fix missed invalid use of cfg val ptr).
Date: Wed Feb 21 19:26:21 2024
Tag: v0.35.0-68-gea3fd13e
- GPU model, driver and version
- GPU: AMD Radeon RX 7900 XTX (radeonsi, navi31, LLVM 16.0.6, DRM 3.57, 6.7.5-arch1-1)
- GPU Driver: 4.6 Mesa 24.0.1-arch1.1
- Possible screenshot or video of visual glitches
- The script I'm using is this: https://github.com/rui-ddc/skip-intro In the video you'll see when the opening starts I press "Tab" to skip forward, it skips forward but causes mpv to go windowed. To tell that it's windowed you can see the window border and waybar bar on the left.
- This test was ran using:
mpv --no-config --script=~/.config/mpv/scripts/skip-intro.lua
https://github.com/mpv-player/mpv/assets/43391109/3a3a969e-c68a-4116-80ba-7d3af4d40bc8
Reproduction steps
- Make sure to download and place the
skip-intro.luascript from https://github.com/rui-ddc/skip-intro into your mpv scripts folder. - Run a video using this command:
mpv --no-config --script=~/.config/mpv/scripts/skip-intro.lua <your-video-here>
or use this command to run the script from the downloads folder.:
mpv --no-config --script=~/Downloads/skip-intro.lua <your-video-here>
- The video doesn't need to be playing. Press tab, press tab again if it didn't stop.
- mpv is now windowed
Expected behaviour
The extra/mpv 1:0.37.0-2 package on arch does the expected behaviour of when you press tab mpv doesn't go windowed when using the skip-intro.lua script. mpv-git doesn't do this.
Actual behaviour
When pressing tab the skip-intro.lua script causes the mpv window to go from fullscreen to windowed.
Log file
Command used: mpv --no-config --script=~/.config/mpv/scripts/skip-intro.lua --log-file=output.txt
output.txt
Sample files
You need to generate a log file when actually triggering the issue, otherwise, nothing interesting will be in it.
Are you on wayland, by any chance? There were a number of wayland-specific commits last week.
Here is the log file with tab pressed: output.txt
Command used:
mpv -fs --no-config --script=~/.config/mpv/scripts/skip-intro.lua --log-file=output.txt '<video-here>.mkv'
Are you on wayland, by any chance?
Yes I am. Hyprland to be specific.
Cannot reproduce on current git master mpv with sway version 1.9-dev-bff991df (Feb 8 2024, branch 'HEAD') on a single output setup. The script attempts to resize window if mpv is windowed but doesn't unmaximize or exit fullscreen if mpv is maximized or in fullscreen.
The log indicates that fullscreen is never set by mpv itself so I think you have custom window rules in Hyprland. You should also upload the log with WAYLAND_DEBUG=1 and also the Hyprland config file.
I can reproduce on hyprland. It's caused by 62a0292dc1eec305cfdda2b5dbfe2aff5640dfd4. The reason is because the vf filter causes a color change which does a reconfig. This did not happen before. I think this is still a hyprland bug however. The wayland backend still correctly sets xdg_toplevel_set_fullscreen in this case in which the compositor should supply us with the fullscreen coordinates. This is what happens with sway and weston which is why they do not have this problem. hyprland returns coordinates equal to the tiled state instead hence the resize.
I have found the problem.
mpv Command Used
mpv -fs --no-config --script=~/.config/mpv/scripts/skip-intro.lua <video-here>
As mpv used --no-config it ran with the default config throughout the tests.
Custom Config
For the initial tests I left sway and hyprland with my custom config.
Single Monitor (1)
- sway version 1.10-dev-d6150b6b (Feb 22 2024, branch 'master') - Cannot Reproduce
- sway version 1.8.1 - Cannot Reproduce
- hyprland-git - Cannot Reproduce
Multi Monitor (2 or more)
- sway version 1.10-dev-d6150b6b (Feb 22 2024, branch 'master') - Cannot Reproduce
- sway version 1.8.1 - Cannot Reproduce
- hyprland-git - Can Reproduce
hyprland-git + mpv-git + custom config = can reproduce hyprland-git + mpv + custom config = cannot reproduce
Default Config
Found here: https://github.com/hyprwm/Hyprland/blob/main/example/hyprland.conf
I then moved onto using the default config for hyprland and didn't test with sway any further.
Single Monitor (1)
- hyprland-git - Cannot Reproduce
Multi Monitor (2 or more)
- hyprland-git - Cannot Reproduce
hyprland-git + mpv-git + default config = cannot reproduce hyprland-git + mpv + default config = cannot reproduce
With the issue not happening with the default config on either mpv or mpv-git, I went through the default settings and replaced each setting until I found the problem.
The Problem
When I moved to hyprland the other day I was getting an error that wouldn't go away unless a windowrule was removed. That being this:
windowrulev2 = suppressevent maximize, class:.* # You'll probably like this.
Re-adding this back into my config no longer gives me the error in hyprland, but is also the setting stopping mpv-git from going windowed. Although with the setting removed mpv doesn't have this issue.
This still looks to me like an mpv-git problem, as hyprland just provides a patch/fix for applications that don't want to play nice with hyprland.
Log File
Running this command looks to give me the same output as not having WAYLAND_DEBUG=1, as all the WAYLAND_DEBUG=1 is in the terminal.
WAYLAND_DEBUG=1 mpv -fs --no-config --script=~/.config/mpv/scripts/skip-intro.lua --log-file=output.txt <video-here>
Even though that's the case I've copied as much as the terminal has given me to a file for you.
hyprland-git
Hyprland, built from branch main at commit 94aeb06d6ba14d403c46b52d1d2e397acb5906a4 dirty (toplevelexport: set last damage for dmabuf copy).
Date: Thu Feb 22 03:10:01 2024
Tag: v0.35.0-69-g94aeb06d
mpv-git
$ mpv --version
mpv v0.37.0-354-gae1a4ed28a Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
built on Feb 22 2024 14:11:49
libplacebo version: v6.338.2
FFmpeg version: n6.1.1
FFmpeg library versions:
libavutil 58.29.100
libavcodec 60.31.102
libavformat 60.16.100
libswscale 7.5.100
libavfilter 9.12.100
libswresample 4.12.100
mpv
$ mpv --version
mpv v0.37.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
built on Jan 19 2024 09:09:45
libplacebo version: v6.338.2
FFmpeg version: n6.1.1
FFmpeg library versions:
libavutil 58.29.100
libavcodec 60.31.102
libavformat 60.16.100
libswscale 7.5.100
libavfilter 9.12.100
libswresample 4.12.100
TL;DR
If you have Hyperland, mpv, skip-intro script and experience it - add
windowrulev2 = suppressevent maximize, class:.*
to Hyperland config