(Go: >> BACK << -|- >> HOME <<)

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpv keeps exiting fullscreen after running skip-intro.lua script #13530

Open
Kagukara opened this issue Feb 22, 2024 · 6 comments
Open

mpv keeps exiting fullscreen after running skip-intro.lua script #13530

Kagukara opened this issue Feb 22, 2024 · 6 comments
Labels
down-upstream features and bugs that need to be implemented and fixed upstream os:linux

Comments

@Kagukara
Copy link

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 paru from the aur package mpv-git
  • If known which version of mpv introduced the problem

    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
unwanted-windowed-mode.mp4

Reproduction steps

  1. Make sure to download and place the skip-intro.lua script from https://github.com/rui-ddc/skip-intro into your mpv scripts folder.
  2. 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>
  1. The video doesn't need to be playing. Press tab, press tab again if it didn't stop.
  2. 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

skip-intro.lua.txt

@Traneptora
Copy link
Member

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.

@Kagukara
Copy link
Author

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.

@na-na-hi
Copy link
Contributor
na-na-hi commented Feb 22, 2024

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.

@Dudemanguy
Copy link
Member

I can reproduce on hyprland. It's caused by 62a0292. 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.

@Dudemanguy Dudemanguy added the down-upstream features and bugs that need to be implemented and fixed upstream label Feb 22, 2024
@Kagukara
Copy link
Author
Kagukara commented Feb 22, 2024

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.

output.txt

wayland-debug-1.txt

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

@oneshotws
Copy link

TL;DR

If you have Hyperland, mpv, skip-intro script and experience it - add
windowrulev2 = suppressevent maximize, class:.*
to Hyperland config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
down-upstream features and bugs that need to be implemented and fixed upstream os:linux
Projects
None yet
Development

No branches or pull requests

5 participants