swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.43k stars 1.1k forks source link

Sway does not send updated wlr_output_head information when enabling an output via IPC #7627

Open hw0lff opened 1 year ago

hw0lff commented 1 year ago

Steps to reproduce

Monitoring the events:

  1. WAYLAND_DEBUG=1 kanshi -c /dev/null

In a separate terminal:

  1. swaymsg output eDP-1 enable (to have it at the end of my shell history)
  2. swaymsg output eDP-1 disable
  3. swaymsg output eDP-1 enable
  4. swaymsg output eDP-1 enable

I waited several seconds between steps [1;3] to see the results of each step with a different timestamp.

What happens

After step 1 at [3197137.*]: kanshi receives a wl_registry.global_remove and gets notified about the disabled wlr_output_head. After step 2 at [3209312.*]: kanshi receives only a wlr_output_manager.done and a wl_registry.global event. After step 3 at [3221293.*]: kanshi gets notified about the enabled wlr_output_head; followed by more wlr_output_head events.

What I expect to happen

When enabling an output via swaymsg output eDP-1 enable, kanshi should receive the wl_registry event together with all the wlr_output_head events. Enabling an output should exhibit inverse behavior to disabling an output (order of events does not matter). Running wlr-randr --output eDP-1 --on exhibits the desired behavior. Using swaymsg should not be different from the wlr-randr command.

Raenthnx commented 1 year ago

Similar issue here on a laptop. Updated sway from 1.8.0 to 1.8.1 Since then, sway does not update output when unplugging hdmi.

What is expected: When I unplug hdmi, i expect to go back to one screen on my workstation, and swaymsg -t get_outputs shows one output.

What happens: i have a "phantom" output (I can move mouse, windows, workspaces to it) and swaymsg -t get_outputs still shows the output I unplugged the hdmi cable from.

Will try to downgrade sway.

Edit: Downgrade fixed it.

Nefsen402 commented 4 weeks ago

I am unable to reproduce the issue on master. Kanshi using WAYLAND_DEBUG=1 is properly receiving the events through zwlr_output_head_v1