mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 18:53:40 +01:00
Fix killactive and movetoworkspace not working in fullscreen
This commit is contained in:
parent
783c7ae0cf
commit
7c643fa66e
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue