mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 03:42:08 +01:00
foreign-toplevel-wlr: fix out-of-range for missing monitor resources
fixes #6635
This commit is contained in:
parent
e09addf8de
commit
8a68199a0c
1 changed files with 6 additions and 4 deletions
|
@ -124,17 +124,19 @@ void CForeignToplevelHandleWlr::sendMonitor(CMonitor* pMonitor) {
|
||||||
|
|
||||||
const auto CLIENT = resource->client();
|
const auto CLIENT = resource->client();
|
||||||
|
|
||||||
if (const auto PLASTMONITOR = g_pCompositor->getMonitorFromID(lastMonitorID); PLASTMONITOR) {
|
if (const auto PLASTMONITOR = g_pCompositor->getMonitorFromID(lastMonitorID); PLASTMONITOR && PROTO::outputs.contains(PLASTMONITOR->szName)) {
|
||||||
const auto OLDRESOURCE = PROTO::outputs.at(PLASTMONITOR->szName)->outputResourceFrom(CLIENT);
|
const auto OLDRESOURCE = PROTO::outputs.at(PLASTMONITOR->szName)->outputResourceFrom(CLIENT);
|
||||||
|
|
||||||
if (OLDRESOURCE)
|
if (OLDRESOURCE)
|
||||||
resource->sendOutputLeave(OLDRESOURCE->getResource()->resource());
|
resource->sendOutputLeave(OLDRESOURCE->getResource()->resource());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (PROTO::outputs.contains(pMonitor->szName)) {
|
||||||
const auto NEWRESOURCE = PROTO::outputs.at(pMonitor->szName)->outputResourceFrom(CLIENT);
|
const auto NEWRESOURCE = PROTO::outputs.at(pMonitor->szName)->outputResourceFrom(CLIENT);
|
||||||
|
|
||||||
if (NEWRESOURCE)
|
if (NEWRESOURCE)
|
||||||
resource->sendOutputEnter(NEWRESOURCE->getResource()->resource());
|
resource->sendOutputEnter(NEWRESOURCE->getResource()->resource());
|
||||||
|
}
|
||||||
|
|
||||||
lastMonitorID = pMonitor->ID;
|
lastMonitorID = pMonitor->ID;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue