summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-06 19:32:14 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-06 19:32:14 +0200
commit663fba76ae08407f196c1cc1b2c775d52b9fdfc9 (patch)
tree5d7e9235567f03cc9692af48fa62a854025b9c9d /src/managers/KeybindManager.cpp
parentd73e05cc681cb7227d69d67c32e735b2705743a6 (diff)
Added resizeactive
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 7d08d358..c3f65b3d 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -25,6 +25,7 @@ CKeybindManager::CKeybindManager() {
m_mDispatchers["moveworkspacetomonitor"] = moveWorkspaceToMonitor;
m_mDispatchers["togglespecialworkspace"] = toggleSpecialWorkspace;
m_mDispatchers["forcerendererreload"] = forceRendererReload;
+ m_mDispatchers["resizeactive"] = resizeActive;
}
void CKeybindManager::addKeybind(SKeybind kb) {
@@ -764,6 +765,8 @@ void CKeybindManager::moveCurrentWorkspaceToMonitor(std::string args) {
}
void CKeybindManager::moveWorkspaceToMonitor(std::string args) {
+ if (args.find_first_of(' ') == std::string::npos)
+ return;
std::string workspace = args.substr(0, args.find_first_of(' '));
std::string monitor = args.substr(args.find_first_of(' ') + 1);
@@ -843,4 +846,22 @@ void CKeybindManager::forceRendererReload(std::string args) {
auto rule = g_pConfigManager->getMonitorRuleFor(m.szName);
g_pHyprRenderer->applyMonitorRule(&m, &rule, true);
}
+}
+
+void CKeybindManager::resizeActive(std::string args) {
+ if (args.find_first_of(' ') == std::string::npos)
+ return;
+
+ std::string x = args.substr(0, args.find_first_of(' '));
+ std::string y = args.substr(args.find_first_of(' ') + 1);
+
+ if (!isNumber(x) || !isNumber(y)) {
+ Debug::log(ERR, "resizeTiledWindow: args not numbers");
+ return;
+ }
+
+ const int X = std::stoi(x);
+ const int Y = std::stoi(y);
+
+ g_pLayoutManager->getCurrentLayout()->resizeActiveWindow(Vector2D(X, Y));
} \ No newline at end of file