mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 17:26:00 +01:00
Add option for retrieving first empty workspace (#1085)
This commit is contained in:
parent
dcb6a0425c
commit
79a9bc9076
1 changed files with 8 additions and 1 deletions
|
@ -244,6 +244,13 @@ int getWorkspaceIDFromString(const std::string& in, std::string& outName) {
|
||||||
result = WORKSPACE->m_iID;
|
result = WORKSPACE->m_iID;
|
||||||
}
|
}
|
||||||
outName = WORKSPACENAME;
|
outName = WORKSPACENAME;
|
||||||
|
} else if (in.find("empty") == 0) {
|
||||||
|
int id = 0;
|
||||||
|
while (++id < INT_MAX) {
|
||||||
|
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(id);
|
||||||
|
if (!PWORKSPACE || (g_pCompositor->getWindowsOnWorkspace(id) == 0))
|
||||||
|
return id;
|
||||||
|
}
|
||||||
} 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