mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 12:29:49 +01:00
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.
This commit is contained in:
parent
d94d8b4ab2
commit
c16044a5c8
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue