Fix crash when moving focus of a node containing multiple windows

This commit is contained in:
outfoxxed 2023-12-10 01:02:23 -08:00
parent f71ac37565
commit b341fe60a7
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E

View file

@ -938,10 +938,12 @@ void Hy3Layout::shiftWindow(int workspace, ShiftDirection direction, bool once,
void Hy3Layout::shiftFocus(int workspace, ShiftDirection direction, bool visible) {
auto* current_window = g_pCompositor->m_pLastWindow;
if (current_window != nullptr) {
auto* p_workspace = g_pCompositor->getWorkspaceByID(current_window->m_iWorkspaceID);
if (p_workspace->m_bHasFullscreenWindow) return;
if (current_window != nullptr && current_window->m_bIsFloating) {
if (current_window->m_bIsFloating) {
auto* next_window = g_pCompositor->getWindowInDirection(
current_window,
direction == ShiftDirection::Left ? 'l'
@ -953,6 +955,7 @@ void Hy3Layout::shiftFocus(int workspace, ShiftDirection direction, bool visible
if (next_window != nullptr) g_pCompositor->focusWindow(next_window);
return;
}
}
auto* node = this->getWorkspaceFocusedNode(workspace);
if (node == nullptr) return;