KZDKM / Hyprspace

Workspace overview plugin for Hyprland
GNU General Public License v2.0
285 stars 9 forks source link

API stability improvement #8

Closed KZDKM closed 1 month ago

KZDKM commented 1 month ago

Currently the plugin abuses function hooks to implement its features. This is a problem since function hooks aren't guaranteed any API stability from hyprland as it updates.

Ideally, the plugin should always use plugin API when possible.

hkOnMouseEvent and hkOnAxisEvent should be replaced by mouseButton and mouseAxis event hooks

hkChangeWorkspace should be replaced by workspace event hook

hkArrangeLayersForMonitor, hkGetWorkspaceRulesFor are for reserving space on active workspace for overview panel and overriding the gaps for the current layout. These could be replaced by a custom layout.

Unfortunately hkRenderWorkspaceWindows is here to stay as there are seemingly no other way of implementing the overview panel to display all layers and windows on other workspaces.

KZDKM commented 1 month ago

https://github.com/KZDKM/Hyprspace/commit/9a274c078574c716039efaa4f2a67bb26f079ea7 has switched input and change workspace hooks to event hooks.

KZDKM commented 1 month ago

Epiphany moment, hyprland exposes render events so we could render our stuff on eRenderStage::RENDER_PRE_WINDOWS. This completely removes the dependency of this plugin on function hooks, I'm fucking stupid, hyprland is awesome.