This commit is contained in:
Vaxry 2024-07-08 15:57:21 +02:00
parent 5d2c274550
commit 8b40a45be0

View File

@ -45,11 +45,22 @@ void CMonitor::onConnect(bool noRule) {
});
listeners.state = output->events.state.registerListener([this](std::any d) {
auto E = std::any_cast<Aquamarine::IOutput::SStateEvent>(d);
if (E.size == Vector2D{}) {
// an indication to re-set state
// we can't do much for createdByUser displays I think
if (createdByUser)
return;
Debug::log(LOG, "Reapplying monitor rule for {} from a state request", szName);
g_pHyprRenderer->applyMonitorRule(this, &activeMonitorRule, true);
return;
}
if (!createdByUser)
return;
auto E = std::any_cast<Aquamarine::IOutput::SStateEvent>(d);
const auto SIZE = E.size;
forceSize = SIZE;