Commit graph

28 commits

Author SHA1 Message Date
ItsDrike be911a842c
Fix crash on groupping floating windows
Resolves #12
2024-04-15 13:28:02 +02:00
ItsDrike ef77c5db1f
Fix for latest hyprland (hyprlang migration) 2024-02-18 17:21:41 +01:00
ItsDrike 66f03d3a08
Remove prefix newlines from demangled func name
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.
2023-10-06 15:13:14 +02:00
ItsDrike 54cf7c6989
Improve wording in log msg 2023-10-03 21:38:13 +02:00
ItsDrike ab36aeeae7
Fix crash on single window group 2023-10-03 20:49:32 +02:00
ItsDrike e78317fdeb
Merge branch 'main' into better-ungroup 2023-10-02 23:55:00 +02:00
ItsDrike 3505d4aa5b
Full rewrite 2023-10-02 22:51:45 +02:00
ItsDrike 03eac7e26b
Improve ungroupping behavior 2023-09-29 20:04:02 +02:00
ItsDrike 879e7a839a
Fix building on v0.30.0
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
2023-09-29 19:03:42 +02:00
ItsDrike ab155b2678
Separate logic for adding child windows to group to func 2023-07-23 15:15:08 +02:00
ItsDrike c38652c26f
Make sure the new group window has group bar
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.
2023-07-23 14:21:37 +02:00
ItsDrike 120a9c33d1
Don't focus a window when inserting to group
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.
2023-07-22 23:11:07 +02:00
ItsDrike c1c883a237
Replicate the new moveIntoGroup behavior
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.
2023-07-22 22:34:11 +02:00
ItsDrike 6bc69d03d6
Define WLR_USE_UNSTABLE in Makefile, not directly in main.cpp 2023-06-07 00:32:58 +02:00
ItsDrike 6218a99a3a
Move to pkg-config
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/.
2023-06-06 23:48:28 +02:00
ItsDrike a826dfbebc
Fix formatting 2023-04-04 00:15:37 +02:00
ItsDrike c62024d74d
Rename addChildNodesToDequeRecursive -> collectChildNodes 2023-04-04 00:15:26 +02:00
ItsDrike 93d3948bfb
Remove unnecessary parents deque from addChildNodesToDequeRecursive 2023-04-04 00:14:44 +02:00
ItsDrike 16f67af969
Only refocus original win after childs were added 2023-04-04 00:12:41 +02:00
ItsDrike bea3f75c19
Restructure the project, making groupCreate and groupDissolve funcs 2023-04-04 00:11:20 +02:00
ItsDrike a9eedb1d72
Add missing return statements on ignores 2023-04-03 17:23:08 +02:00
ItsDrike 9e665e359c
Find correct function based on demangled signature 2023-04-01 00:16:08 +02:00
ItsDrike 312eeaeb34
Fix using wrong getNodeFromWindow function with findFunctionsByName 2023-03-31 23:57:34 +02:00
ItsDrike 6caef995d1
Move to using findFunctionsByName instead of compiler dependant getFunctionAddressFromSignature 2023-03-31 22:44:33 +02:00
ItsDrike 7eca164413
Add initial support for children groupping 2023-03-31 22:32:25 +02:00
ItsDrike 2788905750
Add custom wrapper overriding togglegroup dispatcher 2023-03-31 21:32:28 +02:00
ItsDrike 6f367d865e
Remove unnecessary template code 2023-03-31 14:57:46 +02:00
ItsDrike 2d883200bc
Initial commit 2023-03-31 14:56:32 +02:00