mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-20 15:30:03 +01:00
compositor: dont try to focus unmapped window (#12629)
* compositor: dont try to focus unmapped window if lastwindow is unmapped it hits getWindowInDirection and nullptr derefs window->m_workspace. and coredumps. triggered by dual monitor and one client on each surface with a combination of animation and killactive / movefocus keybind. * keybindmgr: use newly added aliveAndVisible() use newly added aliveAndVisible() over visible()
This commit is contained in:
parent
5700736505
commit
8dfdcfb353
2 changed files with 4 additions and 1 deletions
|
|
@ -1380,6 +1380,9 @@ PHLWINDOW CCompositor::getWindowInDirection(PHLWINDOW pWindow, char dir) {
|
||||||
const auto WINDOWIDEALBB = pWindow->isFullscreen() ? CBox{PMONITOR->m_position, PMONITOR->m_size} : pWindow->getWindowIdealBoundingBoxIgnoreReserved();
|
const auto WINDOWIDEALBB = pWindow->isFullscreen() ? CBox{PMONITOR->m_position, PMONITOR->m_size} : pWindow->getWindowIdealBoundingBoxIgnoreReserved();
|
||||||
const auto PWORKSPACE = pWindow->m_workspace;
|
const auto PWORKSPACE = pWindow->m_workspace;
|
||||||
|
|
||||||
|
if (!PWORKSPACE)
|
||||||
|
return nullptr; // ??
|
||||||
|
|
||||||
return getWindowInDirection(WINDOWIDEALBB, PWORKSPACE, dir, pWindow, pWindow->m_isFloating);
|
return getWindowInDirection(WINDOWIDEALBB, PWORKSPACE, dir, pWindow, pWindow->m_isFloating);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1487,7 +1487,7 @@ SDispatchResult CKeybindManager::moveFocusTo(std::string args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto PLASTWINDOW = Desktop::focusState()->window();
|
const auto PLASTWINDOW = Desktop::focusState()->window();
|
||||||
if (!PLASTWINDOW) {
|
if (!PLASTWINDOW || !PLASTWINDOW->aliveAndVisible()) {
|
||||||
if (*PMONITORFALLBACK)
|
if (*PMONITORFALLBACK)
|
||||||
tryMoveFocusToMonitor(g_pCompositor->getMonitorInDirection(arg));
|
tryMoveFocusToMonitor(g_pCompositor->getMonitorInDirection(arg));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue