From 7c643fa66e783a5ad47386b06be2b165f8bf6003 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 14 Jan 2024 02:43:37 -0800 Subject: [PATCH] Fix killactive and movetoworkspace not working in fullscreen --- src/dispatchers.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dispatchers.cpp b/src/dispatchers.cpp index 3d721bc..667b1cf 100644 --- a/src/dispatchers.cpp +++ b/src/dispatchers.cpp @@ -6,7 +6,7 @@ #include "dispatchers.hpp" #include "globals.hpp" -int workspace_for_action() { +int workspace_for_action(bool allow_fullscreen = false) { if (g_pLayoutManager->getCurrentLayout() != g_Hy3Layout.get()) return -1; int workspace_id = g_pCompositor->m_pLastMonitor->activeWorkspace; @@ -14,7 +14,7 @@ int workspace_for_action() { if (workspace_id == -1) return -1; auto* workspace = g_pCompositor->getWorkspaceByID(workspace_id); if (workspace == nullptr) return -1; - if (workspace->m_bHasFullscreenWindow) return -1; + if (!allow_fullscreen && workspace->m_bHasFullscreenWindow) return -1; return workspace_id; } @@ -120,7 +120,7 @@ void dispatch_movefocus(std::string value) { } void dispatch_move_to_workspace(std::string value) { - int origin_workspace = workspace_for_action(); + int origin_workspace = workspace_for_action(true); if (origin_workspace == -1) return; auto args = CVarList(value); @@ -202,7 +202,7 @@ void dispatch_setswallow(std::string arg) { } void dispatch_killactive(std::string value) { - int workspace = workspace_for_action(); + int workspace = workspace_for_action(true); if (workspace == -1) return; g_Hy3Layout->killFocusedNode(workspace);