mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-08-17 01:00:27 +03:00
foreign-toplevel-wlr: fix out-of-range for missing monitor resources
fixes #6635
This commit is contained in:
parent
e09addf8de
commit
8a68199a0c
@ -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…
Reference in New Issue
Block a user