Skip to content

fix: prevent duplicate layer surfaces on monitor hotplug - #4705

Merged
Alexays merged 1 commit into
Alexays:masterfrom
rwwiv:fix/duplicate-layers-on-monitor-hotplug
Dec 18, 2025
Merged

Alexays merged 1 commit into
Alexays:masterfrom
rwwiv:fix/duplicate-layers-on-monitor-hotplug

Conversation

@rwwiv

@rwwiv rwwiv commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

This PR fixes duplicate waybar layer surfaces appearing after monitor hotplug events.

The signal_monitor_added and signal_monitor_removed handlers were never disconnected during SIGUSR2 reload. Each reload accumulated additional handlers, so when monitors were hotplugged, all accumulated handlers fired and created duplicate layer surfaces.

Changes:

  • Store signal connections as class members
  • Disconnect them before reconnecting in bindInterfaces()
  • Clear stale outputs_ on reload

The monitor signal handlers (signal_monitor_added, signal_monitor_removed)
were never disconnected during SIGUSR2 reload. Each reload accumulated
additional handlers, causing multiple layer surfaces to be created when
monitors were hotplugged.

This fix:
- Stores signal connections as class members
- Disconnects them before reconnecting in bindInterfaces()
- Clears stale outputs_ on reload
@Alexays
Alexays merged commit 374ccbb into Alexays:master Dec 18, 2025
9 checks passed
@Alexays

Alexays commented Dec 18, 2025

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants