mirror of
https://github.com/hyprwm/Hypr.git
synced 2025-12-26 22:00:03 +01:00
move window to relative workspace
This commit is contained in:
parent
404296a173
commit
e94a78af16
6 changed files with 25 additions and 0 deletions
|
|
@ -10,6 +10,10 @@ While Wayland is the future
|
|||
I still want Xorg
|
||||
<br/>
|
||||
|
||||
# Stuff fixed/added so far
|
||||
- Workspace animation direction
|
||||
- Relative workspace switching
|
||||
|
||||
<p align="center">
|
||||
<img src="https://i.imgur.com/LtC153m.png" />
|
||||
<img src="https://github.com/vaxerski/Hypr/actions/workflows/c-cpp.yml/badge.svg" />
|
||||
|
|
|
|||
|
|
@ -171,6 +171,18 @@ void KeybindManager::movefocus(std::string arg) {
|
|||
g_pWindowManager->moveActiveFocusTo(arg[0]);
|
||||
}
|
||||
|
||||
void KeybindManager::movetorelativeworkspace(std::string arg) {
|
||||
try {
|
||||
if (arg == "+")
|
||||
g_pWindowManager->moveActiveWindowToRelativeWorkspace(1);
|
||||
else if (arg == "-")
|
||||
g_pWindowManager->moveActiveWindowToRelativeWorkspace(-1);
|
||||
} catch (...) {
|
||||
Debug::log(ERR, "Invalid arg in movetoworkspace, arg: " + arg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void KeybindManager::movetoworkspace(std::string arg) {
|
||||
try {
|
||||
if (arg == "scratchpad")
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ namespace KeybindManager {
|
|||
void toggleActiveWindowFullscreen(std::string args);
|
||||
void toggleActiveWindowFloating(std::string args);
|
||||
void movetoworkspace(std::string args);
|
||||
void movetorelativeworkspace(std::string args);
|
||||
void changeSplitRatio(std::string args);
|
||||
void togglePseudoActive(std::string args);
|
||||
void toggleScratchpad(std::string args);
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ void handleBind(const std::string& command, const std::string& value) {
|
|||
if (HANDLER == "movewindow") dispatcher = KeybindManager::movewindow;
|
||||
if (HANDLER == "movefocus") dispatcher = KeybindManager::movefocus;
|
||||
if (HANDLER == "movetoworkspace") dispatcher = KeybindManager::movetoworkspace;
|
||||
if (HANDLER == "movetorelativeworkspace") dispatcher = KeybindManager::movetorelativeworkspace;
|
||||
if (HANDLER == "workspace" || HANDLER == "ws") dispatcher = KeybindManager::changeworkspace;
|
||||
if (HANDLER == "relativeworkspace") dispatcher = KeybindManager::changetorelativeworkspace;
|
||||
if (HANDLER == "lastworkspace") dispatcher = KeybindManager::changetolastworkspace;
|
||||
|
|
|
|||
|
|
@ -1553,6 +1553,12 @@ void CWindowManager::warpCursorTo(Vector2D to) {
|
|||
free(pointerreply);
|
||||
}
|
||||
|
||||
void CWindowManager::moveActiveWindowToRelativeWorkspace(int relativenum) {
|
||||
if (activeWorkspaceID + relativenum < lowerWorkspaceLimit) return;
|
||||
if (activeWorkspaceID + relativenum > upperWorkspaceLimit) return;
|
||||
moveActiveWindowToWorkspace(activeWorkspaceID + relativenum);
|
||||
}
|
||||
|
||||
void CWindowManager::moveActiveWindowToWorkspace(int workspace) {
|
||||
|
||||
auto PWINDOW = getWindowFromDrawable(LastWindow);
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ public:
|
|||
void moveActiveWindowTo(char);
|
||||
void moveActiveFocusTo(char);
|
||||
void moveActiveWindowToWorkspace(int);
|
||||
void moveActiveWindowToRelativeWorkspace(int);
|
||||
void warpCursorTo(Vector2D);
|
||||
void toggleWindowFullscrenn(const int&);
|
||||
void recalcAllDocks();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue