mirror of
https://github.com/hyprwm/Hyprland.git
synced 2026-08-24 10:04:19 -05:00
protocols/outputMgmt: fix reload not being fired after no-op commits (#15570)
ref #15526
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "../../../state/MonitorState.hpp"
|
||||
|
||||
#include <ranges>
|
||||
#include <hyprutils/utils/ScopeGuard.hpp>
|
||||
|
||||
using namespace Config;
|
||||
|
||||
@@ -131,7 +132,9 @@ void CMonitorRuleManager::scheduleReload() {
|
||||
}
|
||||
|
||||
void CMonitorRuleManager::ensureMonitorStatus() {
|
||||
std::vector<PHLMONITOR> monsForRefresh;
|
||||
std::vector<PHLMONITOR> monsForRefresh;
|
||||
|
||||
Hyprutils::Utils::CScopeGuard x([this] { m_events.stateReloaded.emit(); });
|
||||
|
||||
for (auto const& m : State::monitorState()->allMonitors()) {
|
||||
if (!m || !m->m_output || m->m_isUnsafeFallback)
|
||||
|
||||
@@ -26,6 +26,10 @@ namespace Config {
|
||||
const std::vector<CMonitorRule>& all();
|
||||
std::vector<CMonitorRule>& allMut();
|
||||
|
||||
struct {
|
||||
CSignalT<> stateReloaded;
|
||||
} m_events;
|
||||
|
||||
private:
|
||||
std::vector<CMonitorRule> m_rules;
|
||||
bool m_reloadScheduled = false;
|
||||
|
||||
@@ -577,7 +577,7 @@ bool COutputConfigurationHead::good() {
|
||||
}
|
||||
|
||||
COutputManagementProtocol::COutputManagementProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
|
||||
static auto P = Event::bus()->m_events.monitor.layoutChanged.listen([this] {
|
||||
static auto P = Config::monitorRuleMgr()->m_events.stateReloaded.listen([this] {
|
||||
updateAllOutputs();
|
||||
sendPendingSuccessEvents();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user