Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
Since the switch from
std::regex
tore2
as a regex library for hyprland (hyprwm/Hyprland@e06b520) themovetodesk
dispatcher(s) are kind of broken.For example with the config:
I previously was able to switch vdesks using
dispatch movetodesk <id>
where<id>
is either1
,2
,3
,4
or5
.When I dispatch
movetodesk 2
without further arguments we havearg = ''
in theVirtualDeskManager::moveToDesk
method.hyprland-virtual-desktops/src/VirtualDeskManager.cpp
Lines 117 to 121 in 45001c5
We then call
getWindowByRegex(arg)
which now returns no window (probably due to us passing an empty string andre2
not liking this in comparison tostd::regex
which most likely just returned the current window). This causes the assertion and therefore every move to fail.I've now wrapped the whole assertion into a check whether
arg
is non-empty. Since we only use thewindow
fromgetWindowByRegex
to determine the target monitor we setmonitor
to the current monitor by default. Shouldarg
be non-empty we try to get a window matching thearg
and setmonitor
to the monitor of the matched window. If no window matches we currently just return and don't move anything. I think it would be better when we log some error and then move to the defaultmonitor
(which is the current monitor) as it's probably more like the functionality which was tried to be achieved by the user.I'm not entirely sure whether this could break some control flows as I don't have this deep of an understanding of the functionalities of the plugin which I only rarely use