aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAlexander Iliev <[email protected]>2024-12-10 22:54:51 +0200
committerGitHub <[email protected]>2024-12-10 21:54:51 +0100
commitc16044a5c88ce9a42987b849068a66c11873575d (patch)
tree60fdf05c73726e2d97fd8ce3adc33940cbd51969 /src
parentd94d8b4ab26a8691a70922f43512f0484c086d85 (diff)
downloadHyprland-c16044a5c88ce9a42987b849068a66c11873575d.tar.gz
Hyprland-c16044a5c88ce9a42987b849068a66c11873575d.zip
core: Fix workspace selector parsing (#8687)
Search for the closing bracket when parsing a workspace selector. This is needed when the `m[desc:<monitor description>]` selector is used, as the monitor description always contains spaces.
Diffstat (limited to 'src')
-rw-r--r--src/desktop/Workspace.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/desktop/Workspace.cpp b/src/desktop/Workspace.cpp
index 3bf89ec3..0230262a 100644
--- a/src/desktop/Workspace.cpp
+++ b/src/desktop/Workspace.cpp
@@ -275,9 +275,9 @@ bool CWorkspace::matchesStaticSelector(const std::string& selector_) {
// f - fullscreen state : f[-1], f[0], f[1], or f[2] for different fullscreen states
// -1: no fullscreen, 0: fullscreen, 1: maximized, 2: fullscreen without sending fs state to window
- const auto NEXTSPACE = selector.find_first_of(' ', i);
- std::string prop = selector.substr(i, NEXTSPACE == std::string::npos ? std::string::npos : NEXTSPACE - i);
- i = std::min(NEXTSPACE, std::string::npos - 1);
+ const auto CLOSING_BRACKET = selector.find_first_of(']', i);
+ std::string prop = selector.substr(i, CLOSING_BRACKET == std::string::npos ? std::string::npos : CLOSING_BRACKET + 1 - i);
+ i = std::min(CLOSING_BRACKET, std::string::npos - 1);
if (cur == 'r') {
WORKSPACEID from = 0, to = 0;