Migrate to V2 API + lua config + compositor and render fixes - #238
Migrate to V2 API + lua config + compositor and render fixes#238ImanolBarba wants to merge 12 commits into
Conversation
getConfigValue and addConfigValue are deprecated addConfigValueV2 creates a shared pointer that is updated dynamically by Hyprland everytime the config is reloaded, so we don't even need to keep track/update the copies
The previous attempt to retrieve config values works if the values themselves are defined (e.g the gesture ones), but if they're undefined (e.g the hyprsplit and other plugin), it crashes This approach makes it safer
An ongoing issue with Lua based config is that dispatchers can't be called directly via hl.dsp.whatever. See: hyprwm/Hyprland#14451 In order to address this, the recommendation is to expose Lua wrapper functions for these dispatchers that can be registered in the Lua VM and used in the config or via hyprctl: ``` $ hyprctl dispatch "function() hl.plugin.overview.toggle() end" ``` Results in the overview effect being triggered. This can also be used in hl.bind calls in lua config tested working on Hyprland 0.55.4
A bunch of upstream compositor functions (and others) were refactored in the last month commits. This commit updates the usages of the functions that have been refactored so it builds on latest git revision Interesting edge case: In the latest Hyprland, `CRenderPass::simplify()` implements an optimization that punches holes in underlying surfaces by subtracting their `opaqueRegion` when an element's alpha reaches 1.0 Because Hyprspace dynamically modifies window geometries using `SRenderModifData`, this optimization incorrectly masks the background, resulting in 100% opaque rectangles (holes) rendering where the windows are. Setting the alpha value to 0.999F achieves the same effect and avoids the issue.
|
Doesn't build anymore on git Details |
|
I'll add some commits to this PR to fix whatever was refactored this week, thanks for the heads up @alba4k |
|
@alba4k can you test it now? |
|
works again, thank you :) |
|
@KZDKM kindly asking for review when available |
work new update ?? Hyprland v0.56.0 ?? |
|
It builds on latest version from git master, so it should |
It wasn't working and threw some errors. After modifying some your PR code, it is now working on Hyprland v0.56.0 |
|
I'm pretty sure I fixed those by looking at the errors have you tried the build on top of my PR? I added the namespace on all those Fullscreen modes and on your error log those changes are not showing |
Yes, I cloned your repo and got these errors while trying to build it using |
|
Yeah this builds cleanly, no changes needed on top of my PR: |
Did you checkout the pr branch? Or just main? |
main branch |
The branch with the changes in this PR is migrate-v2, try that one: LMK how it goes |
okay working add it hyprpm (for main branch) |
|
It works fine for me so it must be something on your end for hyprpm, you can just |
yes working properly, i try to build from default (latest) branch instead of migrate-v2 then getting error |
|
Yeah I forgot to cherry pick the new commits on the latest branch (I was using that for my own testing) I actually didn't know you could pick a specific commit when adding via hyprpm, I've been cherry picking commits and adding local path repos like a caveman :_D |
|
This builds on 0.56.0 but aborts the compositor the first time the overview is opened.
I'd skip patching the static void applyGapsRule(const WORKSPACEID& id, const Config::CCssGapData& gapsIn, const Config::CCssGapData& gapsOut) {
Config::CWorkspaceRule rule;
// replaceOrAdd() and getWorkspaceRuleFor() match on m_workspaceString, so it has to
// be the same identifier text the old parser would have seen
rule.m_workspaceString = std::to_string(id);
const auto& [wsID, wsName, auto_] = getWorkspaceIDNameFromString(rule.m_workspaceString);
rule.m_workspaceName = wsName;
rule.m_workspaceId = auto_ ? WORKSPACE_INVALID : wsID;
rule.m_gapsIn = gapsIn;
rule.m_gapsOut = gapsOut;
Config::workspaceRuleMgr()->replaceOrAdd(std::move(rule));
}Call sites can then pass Unrelated nit while I was in there: Tested on Arch |
|
Ah that's weird, I tested on hyprland git (after 0.56 release, straight from github, not arch repos) and I was able to toggle overview without crashing I'll look into it in a bit, thanks for letting me know |
|
Oh and thanks for the very detailed analysis here btw |
|
Yeah I tested hyprland git before some changes that were squeezed into 0.56, and now it does not even build because as you said, the legacy config manager has been removed. I have applied the changes you suggested and it works and builds now, many thanks! |
Using a function to apply the rules directly (courtesy of @Azeajr)
|
Overview fails to render, breaks window layouts/Waybar, and locks up (cannot close) Hi, this compiles successfully on NixOS. But attempting to open the overview fails to activate the overview interface entirely. Instead, it drops the Waybar layer, unfullscreens any active windows, and forces a large gap between them. The overview itself does not register input or show a workspace matrix, and cannot be closed or exited via the keybind once opened, requiring a restart. No keybinds are registered apart from the one mapped to the overview:toggle, which moves to the next workspace over (1 -> 2 -> 3) Environment Details |
|
Can you attach a picture? Regarding the binding, please check the changes in README, you can't use the regular dispatchers and need to use the lua function examples I added, this is because currently plugin dispatchers are not registered in the Lua VM and need this workaround |
|
Seems to work fine here 2026-07-28.16-58-00.mp4 |
|
Regarding fullscreen, it does un-fullscreen it. I am not familiar whether this is something that didn't happen before and might be an omission in the refactors done for fullscreen mode, or it did actually behave like that before AFAICT, fullscreen status is restored correctly at the very least 2026-07-28.17-04-37.mp4 |
|
I just tested on 0.55 (before the fullscreen refactor) and it behaves exactly like the video above |
|
to be fair, it's beyond the scope of the plugin to keep every old version supported imo. to use it on older versions of hyprland, use an older version of the plugin (install it using |
|
Usually that's what the hyprpm.toml pins are for, they map which git revision should be used for which hyprland version hash (including components) so old version can still work while new versions get fixes pushed on top. The real problem is backporting features, but this PR does none of that |
I have finally gotten around to migrating from hyprlang to lua ( which was pointlessly complex because of conflicts with home-manager on nixos) and it does finally work. Thank you for the answers and pointing in right direction. an error which i have encountered is:
plugin = {
overview = {
panelColor = "rgba(150, 150, 150, 0.2)",
workspaceActiveBorder = "rgba(24, 170, 24, 1)",
workspaceInactiveBorder = "rgba(120, 124, 153, 1)",
reverseSwipe = true,
disableGestures = 0,
drawActiveWorkspace = true,
exitOnClick = true,
panelHeight = 150,
onBottom = false,
disableBlur = true,
-- hideTopLayers = false, -- dont hide the waybar, doesnt work
-- hideOverlayLayers = false, -- dont hide the waybar, doesnt work
-- hideRealLayers = false -- dont hide the waybar
}
} which does not contain P.S. there may be missing README config explanations for panelBaseColor, if that is required to be in the explanations even. |
|
@Petar546 just to make sure I'm understanding the issue: with the above config (albeit in its hyprlang form), you were not having this issue in the latest main revision of this repo correct? But after building with the changes in this PR, you are now having this issue with waybar |
The plugin config is in hl.config with which it functions. |
|
Okay, but what I'm trying to ascertain is whether or not the bug existed before or I introduced it in this PR, hence why I'm asking if you tested the upstream master version (not the one in this PR), with the config, either hyprlang or lua |
|
@KZDKM any chance for a review? Thanks |

This PR:
Pins are updated, so this builds and works cleanly on 0.55.4 as well as latest and greatest in Hyprland git repo