fix: prevent duplicate layer surfaces on monitor hotplug

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
This commit is contained in:
Will Wernert
2025-12-17 22:17:35 -05:00
parent 161367d961
commit a9ef11a2b3
2 changed files with 13 additions and 2 deletions

View File

@ -56,6 +56,8 @@ class Client {
std::list<struct waybar_output> outputs_;
std::unique_ptr<CssReloadHelper> m_cssReloadHelper;
std::string m_cssFile;
sigc::connection monitor_added_connection_;
sigc::connection monitor_removed_connection_;
};
} // namespace waybar