mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-29 18:05:59 +01:00
add prev to getWorkspaceIDFromString
This commit is contained in:
parent
48c86ad863
commit
4ea4efb871
1 changed files with 16 additions and 0 deletions
|
@ -288,6 +288,22 @@ int getWorkspaceIDFromString(const std::string& in, std::string& outName) {
|
||||||
if (!PWORKSPACE || (g_pCompositor->getWindowsOnWorkspace(id) == 0))
|
if (!PWORKSPACE || (g_pCompositor->getWindowsOnWorkspace(id) == 0))
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
} else if (in.find("prev") == 0) {
|
||||||
|
if (!g_pCompositor->m_pLastMonitor)
|
||||||
|
return INT_MAX;
|
||||||
|
|
||||||
|
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace);
|
||||||
|
|
||||||
|
if (!PWORKSPACE)
|
||||||
|
return INT_MAX;
|
||||||
|
|
||||||
|
const auto PLASTWORKSPACE = g_pCompositor->getWorkspaceByID(PWORKSPACE->m_iPrevWorkspaceID);
|
||||||
|
|
||||||
|
if (!PLASTWORKSPACE)
|
||||||
|
return INT_MAX;
|
||||||
|
|
||||||
|
outName = PLASTWORKSPACE->m_szName;
|
||||||
|
return PLASTWORKSPACE->m_iID;
|
||||||
} else {
|
} else {
|
||||||
if ((in[0] == 'm' || in[0] == 'e') && (in[1] == '-' || in[1] == '+') && isNumber(in.substr(2))) {
|
if ((in[0] == 'm' || in[0] == 'e') && (in[1] == '-' || in[1] == '+') && isNumber(in.substr(2))) {
|
||||||
bool onAllMonitors = in[0] == 'e';
|
bool onAllMonitors = in[0] == 'e';
|
||||||
|
|
Loading…
Reference in a new issue