mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 19:49:49 +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();
|
||||
|
||||
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);
|
||||
|
||||
if (OLDRESOURCE)
|
||||
resource->sendOutputLeave(OLDRESOURCE->getResource()->resource());
|
||||
}
|
||||
|
||||
const auto NEWRESOURCE = PROTO::outputs.at(pMonitor->szName)->outputResourceFrom(CLIENT);
|
||||
if (PROTO::outputs.contains(pMonitor->szName)) {
|
||||
const auto NEWRESOURCE = PROTO::outputs.at(pMonitor->szName)->outputResourceFrom(CLIENT);
|
||||
|
||||
if (NEWRESOURCE)
|
||||
resource->sendOutputEnter(NEWRESOURCE->getResource()->resource());
|
||||
if (NEWRESOURCE)
|
||||
resource->sendOutputEnter(NEWRESOURCE->getResource()->resource());
|
||||
}
|
||||
|
||||
lastMonitorID = pMonitor->ID;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue