From 33c8d761ff1c1d2264f7549a7bcfc010929d153c Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Wed, 8 May 2024 15:27:45 -0700 Subject: [PATCH] fix: incorrect usage of as_group without check in focus_tab Closes #106 --- src/Hy3Layout.cpp | 4 +++- src/dispatchers.cpp | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index fc17e5d..64da39f 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -1178,7 +1178,9 @@ void Hy3Layout::focusTab( tab_node = this->getWorkspaceFocusedNode(workspace); if (tab_node == nullptr) return; - while (tab_node != nullptr && tab_node->data.as_group().layout != Hy3GroupLayout::Tabbed + while (tab_node != nullptr + && (tab_node->data.is_window() + || tab_node->data.as_group().layout != Hy3GroupLayout::Tabbed) && tab_node->parent != nullptr) tab_node = tab_node->parent; diff --git a/src/dispatchers.cpp b/src/dispatchers.cpp index 8ea2693..b13a6e0 100644 --- a/src/dispatchers.cpp +++ b/src/dispatchers.cpp @@ -129,9 +129,7 @@ void dispatch_movefocus(std::string value) { g_Hy3Layout->shiftFocus(workspace, shift.value(), visible, warp_cursor); } -void dispatch_warpcursor(std::string value) { - g_Hy3Layout->warpCursor(); -} +void dispatch_warpcursor(std::string value) { g_Hy3Layout->warpCursor(); } void dispatch_move_to_workspace(std::string value) { auto origin_workspace = workspace_for_action(true);