7c643fa66e783a5ad47386b06be2b165f8bf6003

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

Message

Fix killactive and movetoworkspace not working in fullscreen

Diff

 1diff --git a/src/dispatchers.cpp b/src/dispatchers.cpp
 2index 3d721bc62ca624f284001c66a4d846fe77f906c4..667b1cf7a8e4599523ffd8192105aa3b599d8964 100644
 3--- a/src/dispatchers.cpp
 4+++ b/src/dispatchers.cpp
 5@@ -6,7 +6,7 @@
 6 #include "dispatchers.hpp"
 7 #include "globals.hpp"
 8 
 9-int workspace_for_action() {
10+int workspace_for_action(bool allow_fullscreen = false) {
11 	if (g_pLayoutManager->getCurrentLayout() != g_Hy3Layout.get()) return -1;
12 
13 	int workspace_id = g_pCompositor->m_pLastMonitor->activeWorkspace;
14@@ -14,7 +14,7 @@ int workspace_for_action() {
15 	if (workspace_id == -1) return -1;
16 	auto* workspace = g_pCompositor->getWorkspaceByID(workspace_id);
17 	if (workspace == nullptr) return -1;
18-	if (workspace->m_bHasFullscreenWindow) return -1;
19+	if (!allow_fullscreen && workspace->m_bHasFullscreenWindow) return -1;
20 
21 	return workspace_id;
22 }
23@@ -120,7 +120,7 @@ void dispatch_movefocus(std::string value) {
24 }
25 
26 void dispatch_move_to_workspace(std::string value) {
27-	int origin_workspace = workspace_for_action();
28+	int origin_workspace = workspace_for_action(true);
29 	if (origin_workspace == -1) return;
30 
31 	auto args = CVarList(value);
32@@ -202,7 +202,7 @@ void dispatch_setswallow(std::string arg) {
33 }
34 
35 void dispatch_killactive(std::string value) {
36-	int workspace = workspace_for_action();
37+	int workspace = workspace_for_action(true);
38 	if (workspace == -1) return;
39 
40 	g_Hy3Layout->killFocusedNode(workspace);