33c8d761ff1c1d2264f7549a7bcfc010929d153c

Author
outfoxxed <outfoxxed@outfoxxed.me>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

fix: incorrect usage of as_group without check in focus_tab

Closes #106

Diff

 1diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
 2index fc17e5da08abe2323635d70833d4848255659ee4..64da39fa2785765a8b4e38882d8d5219d972aece 100644
 3--- a/src/Hy3Layout.cpp
 4+++ b/src/Hy3Layout.cpp
 5@@ -1178,7 +1178,9 @@ void Hy3Layout::focusTab(
 6 		tab_node = this->getWorkspaceFocusedNode(workspace);
 7 		if (tab_node == nullptr) return;
 8 
 9-		while (tab_node != nullptr && tab_node->data.as_group().layout != Hy3GroupLayout::Tabbed
10+		while (tab_node != nullptr
11+		       && (tab_node->data.is_window()
12+		           || tab_node->data.as_group().layout != Hy3GroupLayout::Tabbed)
13 		       && tab_node->parent != nullptr)
14 			tab_node = tab_node->parent;
15 
16diff --git a/src/dispatchers.cpp b/src/dispatchers.cpp
17index 8ea26932c94aa2c1234c30eabd0168b8e67d0e2d..b13a6e081c3bda8b89309222ac9a7626eb015a86 100644
18--- a/src/dispatchers.cpp
19+++ b/src/dispatchers.cpp
20@@ -129,9 +129,7 @@ void dispatch_movefocus(std::string value) {
21 	g_Hy3Layout->shiftFocus(workspace, shift.value(), visible, warp_cursor);
22 }
23 
24-void dispatch_warpcursor(std::string value) {
25-	g_Hy3Layout->warpCursor();
26-}
27+void dispatch_warpcursor(std::string value) { g_Hy3Layout->warpCursor(); }
28 
29 void dispatch_move_to_workspace(std::string value) {
30 	auto origin_workspace = workspace_for_action(true);