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

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

Open
alxchk opened this issue May 31, 2024 · 2 comments
Labels
bug Not working as intended

Comments

@alxchk
Copy link

alxchk commented May 31, 2024

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 alxchk added the bug Not working as intended label May 31, 2024
@llyyr
Copy link
Contributor

llyyr commented Jun 2, 2024

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.

@alxchk
Copy link
Author

alxchk commented Jun 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

2 participants