Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
5.81k stars 656 forks source link

Multiple waybars open after resume from dpms off. #3344

Open simonm opened 2 weeks ago

simonm commented 2 weeks ago

Hi - I use waybar, hyrpland, hypridle and hyprlock.

Most times I wake from sleep (dpms off), waybar is showing multiple copies of itself.

This can usually be fixed by a simple pkill -SIGUSR2 waybar but this morning I come to my workstation and I have reached a new record. 7 waybars across both monitors!

2024-06-09-110936_hyprshot

Attached are the waybar logs from today, I woke the system (and unlocked screenlock) at 10:59:13. (journalctl --user-unit waybar-hypr.service --since today > waybar-log.txt). waybar-log.txt

❯ waybar --version
Waybar v0.10.3-60-gf4da2039 (branch 'master')
❯ expac '%-30n %v' -s 'waybar|hyprland|hypridle|hyprlock'
hyprcursor                     0.1.9-1
hyprevents-git                 11.09b54e7-1
hypridle                       0.1.2-1
hyprland-git                   0.40.0.r146.a54ab301-1
hyprlock                       0.3.0-1
hyprprop-git                   16.46d12db-1
hyprshot                       1.3.0-1
hyprwayland-scanner            0.3.8-1
waybar-git                     r3484.f4da2039-1
xdg-desktop-portal-hyprland    1.3.1-6

Does anyone have any suggestion on how to troubleshoot?

Thanks

apiraino commented 2 weeks ago

I am also experiencing this with Waybar v0.10.3 and Sway. I was hesitating reporting before I had a concrete reproducible but I didn't yet figure how to trigger this behaviour.

For now I can only confirm that:

By looking at the Waybar code, I am not sure where it happens. Could be even GTK receiving a wrong input on the onConfigure event. Next time I will debug this with GTK_DEBUG=all killall -SIGUSR2 waybar. I sense that I will see more Gtk_Window instances than expected.

khaneliman commented 2 weeks ago

I've had this for a long time, now. I'm on Hyprland. I was not certain of the cause and whether it was a Waybar issue or a Hyprland issue. Its one of those things I kept telling myself I'd look into but never made time for it since I'd usually just restart waybar.service... seeing some of the preliminary findings is motivating, though.

apiraino commented 1 week ago

I could catch this happening with waybar debug logging but unfortunately nothing interesting came out:

First, correct configuration when plugging the external monitor (HDMI-A-2)

[2024-06-19 10:08:07.596] [info] Bar configured (width: 1920, height: 33) for output: eDP-1
[2024-06-19 10:08:07.597] [info] Bar configured (width: 2560, height: 33) for output: HDMI-A-2

Then, correct reconfiguration when unplugging the external monitor:

[2024-06-19 18:27:36.312] [info] Bar removed from output: HDMI-A-2

Then, after waking up from the standby, I see 3 (!) instances of the previous monitor being removed

[2024-06-19 18:27:36.299] [debug] Output removed: Dell Inc. DELL U2515H
[2024-06-19 18:27:36.299] [debug] Output removed: Dell Inc. DELL U2515H
[2024-06-19 18:27:36.299] [debug] Output removed: Dell Inc. DELL U2515H
[2024-06-19 18:27:36.312] [info] Bar removed from output: HDMI-A-2

Relevant code where this is handled.

and finally when plugging the new monitor, 3 instances are configured in a short burst:

[2024-06-19 19:18:29.161] [debug] Output detection done: HDMI-A-2 (WOR TERRA LED2211 22129TB000514)
[2024-06-19 19:18:29.171] [warning] Mapping is not an object
...
[2024-06-19 19:18:29.286] [debug] Output detection done: HDMI-A-2 (WOR TERRA LED2211 22129TB000514)
[2024-06-19 19:18:29.287] [warning] Mapping is not an object
[2024-06-19 19:18:29.340] [debug] Output detection done: HDMI-A-2 (WOR TERRA LED2211 22129TB000514)
[2024-06-19 19:18:29.341] [warning] Mapping is not an object
...
[2024-06-19 19:18:29.831] [info] Bar configured (width: 1920, height: 33) for output: HDMI-A-2
[2024-06-19 19:18:29.831] [info] Bar configured (width: 1920, height: 33) for output: HDMI-A-2
[2024-06-19 19:18:29.831] [info] Bar configured (width: 1920, height: 33) for output: HDMI-A-2

As expected the GTK debug show 3 windows: screenshot-20240619-195003

I have no clue about what is happening here :man_shrugging:

cc @Alexays any insights?

simonm commented 1 week ago

I am testing the gtk4 branch now. Will keep you updated and provide logs.