Add trigger method when pressing lastworkspace hotkey

This commit is contained in:
imaphatduc 2022-01-07 19:09:45 +07:00
parent 32e4d99929
commit 22a2526ddf
2 changed files with 9 additions and 3 deletions

View file

@ -1,6 +1,7 @@
#include "KeybindManager.hpp" #include "KeybindManager.hpp"
#include "utilities/Util.hpp" #include "utilities/Util.hpp"
#include "events/events.hpp" #include "events/events.hpp"
#include "windowManager.hpp"
#include <algorithm> #include <algorithm>
#include <string.h> #include <string.h>
@ -157,11 +158,15 @@ void KeybindManager::changeworkspace(std::string arg) {
if (ID != -1) { if (ID != -1) {
Debug::log(LOG, "Changing the current workspace to " + std::to_string(ID)); Debug::log(LOG, "Changing the current workspace to " + std::to_string(ID));
g_pWindowManager->changeWorkspaceByID(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) { void KeybindManager::toggleActiveWindowFullscreen(std::string unusedArg) {
g_pWindowManager->toggleWindowFullscrenn(g_pWindowManager->LastWindow); g_pWindowManager->toggleWindowFullscrenn(g_pWindowManager->LastWindow);
} }
@ -206,4 +211,4 @@ void KeybindManager::toggleActiveWindowFloating(std::string unusedArg) {
g_pWindowManager->setAllFloatingWindowsTop(); g_pWindowManager->setAllFloatingWindowsTop();
} }
} }

View file

@ -23,7 +23,8 @@ namespace KeybindManager {
void movewindow(std::string args); void movewindow(std::string args);
void movefocus(std::string args); void movefocus(std::string args);
void changeworkspace(std::string args); void changeworkspace(std::string args);
void changetolastworkspace(std::string args);
void toggleActiveWindowFullscreen(std::string args); void toggleActiveWindowFullscreen(std::string args);
void toggleActiveWindowFloating(std::string args); void toggleActiveWindowFloating(std::string args);
void movetoworkspace(std::string args); void movetoworkspace(std::string args);
}; };