From 22a2526ddf4039268066cda83be7f2b8752f3543 Mon Sep 17 00:00:00 2001 From: imaphatduc Date: Fri, 7 Jan 2022 19:09:45 +0700 Subject: [PATCH] Add trigger method when pressing lastworkspace hotkey --- src/KeybindManager.cpp | 9 +++++++-- src/KeybindManager.hpp | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/KeybindManager.cpp b/src/KeybindManager.cpp index 443c639..6ba09dc 100644 --- a/src/KeybindManager.cpp +++ b/src/KeybindManager.cpp @@ -1,6 +1,7 @@ #include "KeybindManager.hpp" #include "utilities/Util.hpp" #include "events/events.hpp" +#include "windowManager.hpp" #include #include @@ -157,11 +158,15 @@ void KeybindManager::changeworkspace(std::string arg) { if (ID != -1) { Debug::log(LOG, "Changing the current workspace to " + std::to_string(ID)); - g_pWindowManager->changeWorkspaceByID(ID); } } +void KeybindManager::changetolastworkspace(std::string arg) { + Debug::log(LOG, "Changing the current workspace to the last workspace"); + g_pWindowManager->changeToLastWorkspace(); +} + void KeybindManager::toggleActiveWindowFullscreen(std::string unusedArg) { g_pWindowManager->toggleWindowFullscrenn(g_pWindowManager->LastWindow); } @@ -206,4 +211,4 @@ void KeybindManager::toggleActiveWindowFloating(std::string unusedArg) { g_pWindowManager->setAllFloatingWindowsTop(); } -} \ No newline at end of file +} diff --git a/src/KeybindManager.hpp b/src/KeybindManager.hpp index eb0948a..08834c0 100644 --- a/src/KeybindManager.hpp +++ b/src/KeybindManager.hpp @@ -23,7 +23,8 @@ namespace KeybindManager { void movewindow(std::string args); void movefocus(std::string args); void changeworkspace(std::string args); + void changetolastworkspace(std::string args); void toggleActiveWindowFullscreen(std::string args); void toggleActiveWindowFloating(std::string args); void movetoworkspace(std::string args); -}; \ No newline at end of file +};