sway icon indicating copy to clipboard operation
sway copied to clipboard

Full screen mpv locks output if was launched at other output, which was detached

Open alxchk opened this issue 1 year ago • 2 comments

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

  1. Start some video in mpv at screen (1)
  2. Move output to screen (2)
  3. Make video full screen
  4. Disable screen (2) (swaymsg output SCR2 disable; swaymsg output SCR1 pos 0 0 )
  5. Video is now played at screen (1) in full-screen mode
  6. If you close mpv or exit full-screen mode there will be black screen
  7. To recover - re-enable screen (1)

alxchk avatar May 31 '24 06:05 alxchk

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.

llyyr avatar Jun 02 '24 07:06 llyyr

Okay, I made a bit more experiments, and it turns out, that I miss something important.

  1. It's not just mpv, it is any full screen app
  2. 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.

alxchk avatar Jun 02 '24 08:06 alxchk