Limit workspace from 1 to 10 (relative switching)

This commit is contained in:
end-4 2023-01-22 20:37:43 +07:00
parent 63d0b11f9c
commit b5a66c165d
3 changed files with 4 additions and 1 deletions

View file

@ -8,7 +8,6 @@ As the name suggests
While Wayland is the future
I still want Xorg
<br/>
<p align="center">

View file

@ -1756,6 +1756,8 @@ void CWindowManager::moveActiveFocusTo(char dir) {
}
void CWindowManager::relativeWorkspace(int relativenum) {
if (activeWorkspaceID + relativenum < lowerWorkspaceLimit) return;
if (activeWorkspaceID + relativenum > upperWorkspaceLimit) return;
changeWorkspaceByID(activeWorkspaceID + relativenum);
}

View file

@ -54,6 +54,8 @@ public:
std::deque<int> activeWorkspaces;
int lastActiveWorkspaceID = 1;
int activeWorkspaceID = 1;
int upperWorkspaceLimit = 10;
int lowerWorkspaceLimit = 1;
// Not really pipes, but files. Oh well. Used for IPC.
SIPCPipe m_sIPCBarPipeIn = {ISDEBUG ? "/tmp/hypr/hyprbarind" : "/tmp/hypr/hyprbarin", 0};