The demangled function names from HyprlandAPI::findFunctionsByName were
originally always returning a string prefixed with a newline character.
This was fixed in Hyprland since
1afb00a01b
so the newline char can now be removed.
Since Hyprland commit
<3785defaf1>
building the plugin was failing with `CHyprGroupBarDecoration` not being
declared. This happened because this commit has removed an include in
`layout/DwindleLayout.hpp` that contained this struct.
Instead of relying on that include being in `DwindleLayout.hpp`, we now
include it ourselves directly from
`render/decorations/CHyprGroupBarDecoration.hpp`.
Note that even with this fix, the plugin will not be buildable until
Hyprland commit
<1925e64c21>
which fixes another issue created by the commit above, where the
`helpers/Vector2D.hpp` had a typo in `macros.hpp` include, which
should've been `../macros.hpp`.
That said, this commit is a part of version 0.30.0, where the plugin is
now working without issues.
Fixes#7
The previous commit (120a9c33d1) reworked
the behavior for inserting windows into groups, however in this rework,
the code for adding a group bar window decoration was also removed,
assuming that the CWindow::insertWindowToGroup would do that
automatically. Apparently this is not the case, and we still need to do
it manually.
This therefore just brings the code for adding the group bar back,
fixing this issue.
The changes the behavior of groupCreate function when adding each of the
dwindle child node windows into a group, to no longer also focus them,
only to later refocus back on the original group's head/visible window.
This was impossible before, as the CWindow::insertWindowToGroup function
automatically made the inserted window the group's head/current window,
however since that's no longer the case - see the previous commit:
c1c883a237 it is now possible to remove
this janky behavior for a much cleaner one, where the window is simply
moved into a group and marked as hidden immediately.
Hyprland has updated some of the core functions related to groupping
windows in PR: https://github.com/hyprwm/Hyprland/pull/2630
Specifically, the CWindow::insertWindowIntoGroup was updated to no
longer automatically make the newly inserted window the group's head,
allowing to insert windows without the group auto-focusing them.
With that, the CKeybindManager::moveIntoGroup (dispatcher) function was
then updated to adhere to the change in insertWindowIntoGroup and to
make the inserted widow the group's head from there.
It's probably possible to utilize the insertWindowIntoGroup without
making the inserted window the group's head in a more clever way,
however for now, this commit just changes our logic in groupCreate
function to fully replicate the moveIntoGroup for each dwindle child
node window.
This means we're still doing what we were doing before, that is to
insert a window, make it the group head, repeat for each dwindle child
and at the end make the original group head the head again.
The reason this fix doesn't simply skip making each of the nodes a group
head is that without it, the layout doesn't seem to properly recognize
that the window should no longer be shown, and while this probably can
be addressed by replicating some of the CWindow::setGroupCurrent
function's behavior, for now, that's a task for later.
Hyprland has recently changed the way plugins recognize the hyprland
headers, moving from directly including the paths with -I option to
automatically generating the cflags with `pkg-config --cflags hyprland`.
This change means that compilation attempts using the direct include
option will start to fail with newer versions of hyprland, which now
uses /usr/local/include for it's headers after `make pluginenv`.
This commit migrates the original system to respect this change,
modifying Makefile, and with it, the include paths for hyprland headers,
which are now prefixed with hyprland/.