Full screen mpv locks output if was launched at other output, which was detached
This bug reproduces with 100% probability at my setup. In case it's just for me, I will provide additional information.
This reproduced for a long time, probably since switching to linux-dmabuf.
sway version 1.10-dev-97041524 (May 23 2024, branch 'HEAD') - still there
Steps to reproduce. 0. You need 2 displays
- Start some video in mpv at screen (1)
- Move output to screen (2)
- Make video full screen
- Disable screen (2) (swaymsg output SCR2 disable; swaymsg output SCR1 pos 0 0 )
- Video is now played at screen (1) in full-screen mode
- If you close mpv or exit full-screen mode there will be black screen
- To recover - re-enable screen (1)
Can't reproduce, when I exit mpv or toggle fullscreen in step 6, my screen 2 stays disabled as it should and my screen 1 remains enabled as it should.
Okay, I made a bit more experiments, and it turns out, that I miss something important.
- It's not just mpv, it is any full screen app
- The script I use to disable screen is a bit more complex
I use laptop + monitor configuration, and if docked, most of time laptop's lid is closed. I rarely open it to do something, and the screen there is secondary. So I had this script to handle lid close:
#!/bin/sh
is_dp5_active=`swaymsg -r -t get_outputs | jq -r '.[] | select(.active and .name == "DP-5") | 1'`
is_dp6_active=`swaymsg -r -t get_outputs | jq -r '.[] | select(.active and .name == "DP-6") | 1'`
if grep -q open /proc/acpi/button/lid/LID/state; then
echo "Enable laptop output"
swaymsg output eDP-1 enable
if [ ! -z "${is_dp5_active}" ]; then
swaymsg output DP-5 pos 1920 0
fi
if [ ! -z "${is_dp6_active}" ]; then
swaymsg output DP-6 pos 1920 0
fi
else
echo "Disable laptop output"
swaymsg output eDP-1 disable
if [ ! -z "${is_dp5_active}" ]; then
swaymsg output DP-5 pos 0 0
fi
if [ ! -z "${is_dp6_active}" ]; then
swaymsg output DP-6 pos 0 0
fi
fi
The part with pos X Y is important here. I added that a long time ago, to workaround some bug with Xwayland QT apps in wine, and forgot about it. Looks like without pos bug with fullscreen can not be reproduced - everything works as expected. But bug with Xwayland is still there, so can't use that as workaround.