Skip to content

Migrate to V2 API + lua config + compositor and render fixes - #238

Open
ImanolBarba wants to merge 12 commits into
KZDKM:mainfrom
ImanolBarba:migrate-v2
Open

Migrate to V2 API + lua config + compositor and render fixes#238
ImanolBarba wants to merge 12 commits into
KZDKM:mainfrom
ImanolBarba:migrate-v2

Conversation

@ImanolBarba

Copy link
Copy Markdown

This PR:

  1. cleanly migrates to V2 plugin API (no more deprecated warnings)
  2. Adds Lua wrapper functions so that Lua based configs are able to call and bind dispatchers (rationale discussed here: plugin dispatchers not discoverable through hyprctl dispatch for .lua in 0.55 (works for .conf in 0.55) hyprwm/Hyprland#14451)
  3. Updates the recent compositor, workspace, window and monitor upstream refactors, and fixes an artifact introduced by the recent render optimisations

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

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.
@alba4k

alba4k commented Jul 10, 2026

Copy link
Copy Markdown
preview image

works great!

@alba4k

alba4k commented Jul 16, 2026

Copy link
Copy Markdown

Doesn't build anymore on git

Details
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╍━━━━━━━━━━━━━━━━━━━  3 / 5  Building plugin(s)[v] shell returned:  -> cd /run/user/1000/hyprpm/alba4k && PKG_CONFIG_PATH="/var/cache/hyprpm/alba4k/headersRoot/share/pkgconfig:$PKG_CONFIG_PATH" make all
g++ -shared -fPIC --no-gnu-unique -Wall -g -DWLR_USE_UNSTABLE -std=c++2b -O2 `pkg-config --cflags pixman-1 libdrm hyprland pangocairo libinput libudev wayland-server xkbcommon lua` src/Input.cpp src/Layout.cpp src/Lua.cpp src/main.cpp src/Overview.cpp src/Render.cpp -o Hyprspace.so
In file included from src/Input.cpp:6:
src/Overview.hpp:20:42: error: ‘eFullscreenMode’ was not declared in this scope
   20 |     std::vector<std::tuple<PHLWINDOWREF, eFullscreenMode>> prevFullscreen;
      |                                          ^~~~~~~~~~~~~~~
src/Overview.hpp:20:42: error: template argument 2 is invalid
src/Overview.hpp:20:57: error: template argument 1 is invalid
   20 |     std::vector<std::tuple<PHLWINDOWREF, eFullscreenMode>> prevFullscreen;
      |                                                         ^~
src/Overview.hpp:20:57: error: template argument 2 is invalid
src/Input.cpp: In member function ‘bool CHyprspaceWidget::buttonEvent(bool, Hyprutils::Math::Vector2D)’:
src/Input.cpp:64:28: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realPosition’ is protected within this context
   64 |             *targetWindow->m_realPosition = targetPos;
      |                            ^~~~~~~~~~~~~~
In file included from /var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/Window.hpp:25,
                 from src/Input.cpp:1:
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:29:30: note: declared protected here
   29 |         PHLANIMVAR<Vector2D> m_realPosition;
      |                              ^~~~~~~~~~~~~~
In file included from src/Layout.cpp:1:
src/Overview.hpp:20:42: error: ‘eFullscreenMode’ was not declared in this scope
   20 |     std::vector<std::tuple<PHLWINDOWREF, eFullscreenMode>> prevFullscreen;
      |                                          ^~~~~~~~~~~~~~~
src/Overview.hpp:20:42: error: template argument 2 is invalid
src/Overview.hpp:20:57: error: template argument 1 is invalid
   20 |     std::vector<std::tuple<PHLWINDOWREF, eFullscreenMode>> prevFullscreen;
      |                                                         ^~
src/Overview.hpp:20:57: error: template argument 2 is invalid
In file included from src/main.cpp:13:
src/Overview.hpp:20:42: error: ‘eFullscreenMode’ was not declared in this scope
   20 |     std::vector<std::tuple<PHLWINDOWREF, eFullscreenMode>> prevFullscreen;
      |                                          ^~~~~~~~~~~~~~~
src/Overview.hpp:20:42: error: template argument 2 is invalid
src/Overview.hpp:20:57: error: template argument 1 is invalid
   20 |     std::vector<std::tuple<PHLWINDOWREF, eFullscreenMode>> prevFullscreen;
      |                                                         ^~
src/Overview.hpp:20:57: error: template argument 2 is invalid
In file included from src/Overview.cpp:1:
src/Overview.hpp:20:42: error: ‘eFullscreenMode’ was not declared in this scope
   20 |     std::vector<std::tuple<PHLWINDOWREF, eFullscreenMode>> prevFullscreen;
      |                                          ^~~~~~~~~~~~~~~
src/Overview.hpp:20:42: error: template argument 2 is invalid
src/Overview.hpp:20:57: error: template argument 1 is invalid
   20 |     std::vector<std::tuple<PHLWINDOWREF, eFullscreenMode>> prevFullscreen;
      |                                                         ^~
src/Overview.hpp:20:57: error: template argument 2 is invalid
src/Overview.cpp: In member function ‘void CHyprspaceWidget::show()’:
src/Overview.cpp:36:9: error: ‘prevFullscreen’ was not declared in this scope
   36 |     if (prevFullscreen.empty()) {
      |         ^~~~~~~~~~~~~~
src/Overview.cpp:40:36: error: ‘class CWorkspace’ has no member named ‘getFullscreenWindow’
   40 |                 const auto w = ws->getFullscreenWindow();
      |                                    ^~~~~~~~~~~~~~~~~~~
src/Overview.cpp:41:41: error: ‘class CWorkspace’ has no member named ‘m_fullscreenMode’
   41 |                 if (w != nullptr && ws->m_fullscreenMode != FSMODE_NONE) {
      |                                         ^~~~~~~~~~~~~~~~
src/Overview.cpp:41:61: error: ‘FSMODE_NONE’ was not declared in this scope
   41 |                 if (w != nullptr && ws->m_fullscreenMode != FSMODE_NONE) {
      |                                                             ^~~~~~~~~~~
src/Overview.cpp:44:29: error: ‘class CWorkspace’ has no member named ‘m_fullscreenMode’
   44 |                     if (ws->m_fullscreenMode == FSMODE_FULLSCREEN) w->m_wantsInitialFullscreen = true;
      |                             ^~~~~~~~~~~~~~~~
src/Overview.cpp:44:49: error: ‘FSMODE_FULLSCREEN’ was not declared in this scope
   44 |                     if (ws->m_fullscreenMode == FSMODE_FULLSCREEN) w->m_wantsInitialFullscreen = true;
      |                                                 ^~~~~~~~~~~~~~~~~
src/Overview.cpp:45:86: error: ‘class CWorkspace’ has no member named ‘m_fullscreenMode’
   45 |                     prevFullscreen.emplace_back(std::make_tuple(PHLWINDOWREF(w), ws->m_fullscreenMode));
      |                                                                                      ^~~~~~~~~~~~~~~~
src/Overview.cpp:46:36: error: ‘class CCompositor’ has no member named ‘setWindowFullscreenState’
   46 |                     g_pCompositor->setWindowFullscreenState(w, Desktop::View::SFullscreenState{.internal = FSMODE_NONE, .client = FSMODE_NONE});
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~
src/Overview.cpp:46:79: error: ‘SFullscreenState’ is not a member of ‘Desktop::View’
   46 |                     g_pCompositor->setWindowFullscreenState(w, Desktop::View::SFullscreenState{.internal = FSMODE_NONE, .client = FSMODE_NONE});
      |                                                                               ^~~~~~~~~~~~~~~~
src/Overview.cpp: In member function ‘void CHyprspaceWidget::hide()’:
src/Overview.cpp:106:21: error: ‘prevFullscreen’ was not declared in this scope
  106 |     for (auto& fs : prevFullscreen) {
      |                     ^~~~~~~~~~~~~~
src/Overview.cpp:110:24: error: ‘class CCompositor’ has no member named ‘setWindowFullscreenState’
  110 |         g_pCompositor->setWindowFullscreenState(w, Desktop::View::SFullscreenState(oFullscreenMode));
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~
src/Overview.cpp:110:67: error: ‘SFullscreenState’ is not a member of ‘Desktop::View’
  110 |         g_pCompositor->setWindowFullscreenState(w, Desktop::View::SFullscreenState(oFullscreenMode));
      |                                                                   ^~~~~~~~~~~~~~~~
src/Overview.cpp:111:32: error: ‘FSMODE_FULLSCREEN’ was not declared in this scope
  111 |         if (oFullscreenMode == FSMODE_FULLSCREEN) w->m_wantsInitialFullscreen = false;
      |                                ^~~~~~~~~~~~~~~~~
src/Overview.cpp:113:5: error: ‘prevFullscreen’ was not declared in this scope
  113 |     prevFullscreen.clear();
      |     ^~~~~~~~~~~~~~
In file included from src/Render.cpp:1:
src/Overview.hpp:20:42: error: ‘eFullscreenMode’ was not declared in this scope
   20 |     std::vector<std::tuple<PHLWINDOWREF, eFullscreenMode>> prevFullscreen;
      |                                          ^~~~~~~~~~~~~~~
src/Overview.hpp:20:42: error: template argument 2 is invalid
src/Overview.hpp:20:57: error: template argument 1 is invalid
   20 |     std::vector<std::tuple<PHLWINDOWREF, eFullscreenMode>> prevFullscreen;
      |                                                         ^~
src/Overview.hpp:20:57: error: template argument 2 is invalid
src/Render.cpp: In function ‘void renderWindowStub(PHLWINDOW, PHLMONITOR, PHLWORKSPACE, Hyprutils::Math::CBox, Hyprutils::Math::CBox, const Time::steady_tp&)’:
src/Render.cpp:48:41: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realPosition’ is protected within this context
   48 |     const auto oRealPosition = pWindow->m_realPosition->value();
      |                                         ^~~~~~~~~~~~~~
In file included from /var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/Window.hpp:25,
                 from /var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/Compositor.hpp:11,
                 from src/Overview.hpp:2:
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:29:30: note: declared protected here
   29 |         PHLANIMVAR<Vector2D> m_realPosition;
      |                              ^~~~~~~~~~~~~~
src/Render.cpp:49:33: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realSize’ is protected within this context
   49 |     const auto oSize = pWindow->m_realSize->value();
      |                                 ^~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:30:30: note: declared protected here
   30 |         PHLANIMVAR<Vector2D> m_realSize;
      |                              ^~~~~~~~~~
src/Render.cpp:74:48: error: ‘class Desktop::View::CWindow’ has no member named ‘isEffectiveInternalFSMode’
   74 |     renderdata.dontRound            = pWindow->isEffectiveInternalFSMode(FSMODE_FULLSCREEN);
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
src/Render.cpp:74:74: error: ‘FSMODE_FULLSCREEN’ was not declared in this scope
   74 |     renderdata.dontRound            = pWindow->isEffectiveInternalFSMode(FSMODE_FULLSCREEN);
      |                                                                          ^~~~~~~~~~~~~~~~~
src/Render.cpp: In function ‘void renderLayerStub(PHLLS, PHLMONITOR, Hyprutils::Math::CBox, Hyprutils::Math::CBox, const Time::steady_tp&)’:
src/Render.cpp:110:38: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realPosition’ is protected within this context
  110 |     Vector2D oRealPosition = pLayer->m_realPosition->value();
      |                                      ^~~~~~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:29:30: note: declared protected here
   29 |         PHLANIMVAR<Vector2D> m_realPosition;
      |                              ^~~~~~~~~~~~~~
src/Render.cpp:111:30: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realSize’ is protected within this context
  111 |     Vector2D oSize = pLayer->m_realSize->value();
      |                              ^~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:30:30: note: declared protected here
   30 |         PHLANIMVAR<Vector2D> m_realSize;
      |                              ^~~~~~~~~~
src/Render.cpp: In member function ‘void CHyprspaceWidget::draw()’:
src/Render.cpp:311:63: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realPosition’ is protected within this context
  311 |                 CBox layerBox = {curWorkspaceBox.pos() + (ls->m_realPosition->value() - owner->m_position) * monitorSizeScaleFactor, ls->m_realSize->value() * monitorSizeScaleFactor};
      |                                                               ^~~~~~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:29:30: note: declared protected here
   29 |         PHLANIMVAR<Vector2D> m_realPosition;
      |                              ^~~~~~~~~~~~~~
src/Render.cpp:311:138: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realSize’ is protected within this context
  311 |                 CBox layerBox = {curWorkspaceBox.pos() + (ls->m_realPosition->value() - owner->m_position) * monitorSizeScaleFactor, ls->m_realSize->value() * monitorSizeScaleFactor};
      |                                                                                                                                          ^~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:30:30: note: declared protected here
   30 |         PHLANIMVAR<Vector2D> m_realSize;
      |                              ^~~~~~~~~~
src/Render.cpp:315:63: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realPosition’ is protected within this context
  315 |                 CBox layerBox = {curWorkspaceBox.pos() + (ls->m_realPosition->value() - owner->m_position) * monitorSizeScaleFactor, ls->m_realSize->value() * monitorSizeScaleFactor};
      |                                                               ^~~~~~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:29:30: note: declared protected here
   29 |         PHLANIMVAR<Vector2D> m_realPosition;
      |                              ^~~~~~~~~~~~~~
src/Render.cpp:315:138: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realSize’ is protected within this context
  315 |                 CBox layerBox = {curWorkspaceBox.pos() + (ls->m_realPosition->value() - owner->m_position) * monitorSizeScaleFactor, ls->m_realSize->value() * monitorSizeScaleFactor};
      |                                                                                                                                          ^~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:30:30: note: declared protected here
   30 |         PHLANIMVAR<Vector2D> m_realSize;
      |                              ^~~~~~~~~~
src/Render.cpp:340:64: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realPosition’ is protected within this context
  340 |                     double wX = curWorkspaceRectOffsetX + ((w->m_realPosition->value().x - owner->m_position.x) * monitorSizeScaleFactor * owner->m_scale);
      |                                                                ^~~~~~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:29:30: note: declared protected here
   29 |         PHLANIMVAR<Vector2D> m_realPosition;
      |                              ^~~~~~~~~~~~~~
src/Render.cpp:341:64: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realPosition’ is protected within this context
  341 |                     double wY = curWorkspaceRectOffsetY + ((w->m_realPosition->value().y - owner->m_position.y) * monitorSizeScaleFactor * owner->m_scale);
      |                                                                ^~~~~~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:29:30: note: declared protected here
   29 |         PHLANIMVAR<Vector2D> m_realPosition;
      |                              ^~~~~~~~~~~~~~
src/Render.cpp:342:36: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realSize’ is protected within this context
  342 |                     double wW = w->m_realSize->value().x * monitorSizeScaleFactor * owner->m_scale;
      |                                    ^~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:30:30: note: declared protected here
   30 |         PHLANIMVAR<Vector2D> m_realSize;
      |                              ^~~~~~~~~~
src/Render.cpp:343:36: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realSize’ is protected within this context
  343 |                     double wH = w->m_realSize->value().y * monitorSizeScaleFactor * owner->m_scale;
      |                                    ^~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:30:30: note: declared protected here
   30 |         PHLANIMVAR<Vector2D> m_realSize;
      |                              ^~~~~~~~~~
src/Render.cpp:354:64: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realPosition’ is protected within this context
  354 |                     double wX = curWorkspaceRectOffsetX + ((w->m_realPosition->value().x - owner->m_position.x) * monitorSizeScaleFactor * owner->m_scale);
      |                                                                ^~~~~~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:29:30: note: declared protected here
   29 |         PHLANIMVAR<Vector2D> m_realPosition;
      |                              ^~~~~~~~~~~~~~
src/Render.cpp:355:64: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realPosition’ is protected within this context
  355 |                     double wY = curWorkspaceRectOffsetY + ((w->m_realPosition->value().y - owner->m_position.y) * monitorSizeScaleFactor * owner->m_scale);
      |                                                                ^~~~~~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:29:30: note: declared protected here
   29 |         PHLANIMVAR<Vector2D> m_realPosition;
      |                              ^~~~~~~~~~~~~~
src/Render.cpp:356:36: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realSize’ is protected within this context
  356 |                     double wW = w->m_realSize->value().x * monitorSizeScaleFactor * owner->m_scale;
      |                                    ^~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:30:30: note: declared protected here
   30 |         PHLANIMVAR<Vector2D> m_realSize;
      |                              ^~~~~~~~~~
src/Render.cpp:357:36: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realSize’ is protected within this context
  357 |                     double wH = w->m_realSize->value().y * monitorSizeScaleFactor * owner->m_scale;
      |                                    ^~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:30:30: note: declared protected here
   30 |         PHLANIMVAR<Vector2D> m_realSize;
      |                              ^~~~~~~~~~
src/Render.cpp:368:64: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realPosition’ is protected within this context
  368 |                     double wX = curWorkspaceRectOffsetX + ((w->m_realPosition->value().x - owner->m_position.x) * monitorSizeScaleFactor * owner->m_scale);
      |                                                                ^~~~~~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:29:30: note: declared protected here
   29 |         PHLANIMVAR<Vector2D> m_realPosition;
      |                              ^~~~~~~~~~~~~~
src/Render.cpp:369:64: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realPosition’ is protected within this context
  369 |                     double wY = curWorkspaceRectOffsetY + ((w->m_realPosition->value().y - owner->m_position.y) * monitorSizeScaleFactor * owner->m_scale);
      |                                                                ^~~~~~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:29:30: note: declared protected here
   29 |         PHLANIMVAR<Vector2D> m_realPosition;
      |                              ^~~~~~~~~~~~~~
src/Render.cpp:370:36: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realSize’ is protected within this context
  370 |                     double wW = w->m_realSize->value().x * monitorSizeScaleFactor * owner->m_scale;
      |                                    ^~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:30:30: note: declared protected here
   30 |         PHLANIMVAR<Vector2D> m_realSize;
      |                              ^~~~~~~~~~
src/Render.cpp:371:36: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realSize’ is protected within this context
  371 |                     double wH = w->m_realSize->value().y * monitorSizeScaleFactor * owner->m_scale;
      |                                    ^~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:30:30: note: declared protected here
   30 |         PHLANIMVAR<Vector2D> m_realSize;
      |                              ^~~~~~~~~~
src/Render.cpp:383:67: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realPosition’ is protected within this context
  383 |                     CBox layerBox = {curWorkspaceBox.pos() + (ls->m_realPosition->value() - owner->m_position) * monitorSizeScaleFactor, ls->m_realSize->value() * monitorSizeScaleFactor};
      |                                                                   ^~~~~~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:29:30: note: declared protected here
   29 |         PHLANIMVAR<Vector2D> m_realPosition;
      |                              ^~~~~~~~~~~~~~
src/Render.cpp:383:142: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realSize’ is protected within this context
  383 |                     CBox layerBox = {curWorkspaceBox.pos() + (ls->m_realPosition->value() - owner->m_position) * monitorSizeScaleFactor, ls->m_realSize->value() * monitorSizeScaleFactor};
      |                                                                                                                                              ^~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:30:30: note: declared protected here
   30 |         PHLANIMVAR<Vector2D> m_realSize;
      |                              ^~~~~~~~~~
src/Render.cpp:389:67: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realPosition’ is protected within this context
  389 |                     CBox layerBox = {curWorkspaceBox.pos() + (ls->m_realPosition->value() - owner->m_position) * monitorSizeScaleFactor, ls->m_realSize->value() * monitorSizeScaleFactor};
      |                                                                   ^~~~~~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:29:30: note: declared protected here
   29 |         PHLANIMVAR<Vector2D> m_realPosition;
      |                              ^~~~~~~~~~~~~~
src/Render.cpp:389:142: error: ‘PHLANIMVAR<Hyprutils::Math::Vector2D> Desktop::View::CGeometricMovableAnimated::m_realSize’ is protected within this context
  389 |                     CBox layerBox = {curWorkspaceBox.pos() + (ls->m_realPosition->value() - owner->m_position) * monitorSizeScaleFactor, ls->m_realSize->value() * monitorSizeScaleFactor};
      |                                                                                                                                              ^~~~~~~~~~
/var/cache/hyprpm/alba4k/headersRoot/include/hyprland/src/desktop/view/types/GeometricMovableAnimated.hpp:30:30: note: declared protected here
   30 |         PHLANIMVAR<Vector2D> m_realSize;
      |                              ^~~~~~~~~~
make: *** [Makefile:9: all] Error 1

@ImanolBarba

Copy link
Copy Markdown
Author

I'll add some commits to this PR to fix whatever was refactored this week, thanks for the heads up @alba4k

@ImanolBarba

Copy link
Copy Markdown
Author

@alba4k can you test it now?

@alba4k

alba4k commented Jul 19, 2026

Copy link
Copy Markdown

works again, thank you :)

@ImanolBarba

Copy link
Copy Markdown
Author

@KZDKM kindly asking for review when available

@0xl30

0xl30 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@KZDKM kindly asking for review when available

work new update ?? Hyprland v0.56.0 ??

@ImanolBarba

Copy link
Copy Markdown
Author

It builds on latest version from git master, so it should

@0xl30

0xl30 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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

error.txt

https://github.com/0xl30/Hyprspace

@ImanolBarba

Copy link
Copy Markdown
Author

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

@0xl30

0xl30 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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

git clone https://github.com/ImanolBarba/Hyprspace.git
cd Hyprspace
make all 

@ImanolBarba

Copy link
Copy Markdown
Author

Yeah this builds cleanly, no changes needed on top of my PR:

[root@8cbf798e614a work]# cd Hyprspace
[root@8cbf798e614a Hyprspace]# make all
g++ -shared -fPIC --no-gnu-unique -Wall -g -DWLR_USE_UNSTABLE -std=c++2b -O2 `pkg-config --cflags pixman-1 libdrm hyprland pangocairo libinput libudev wayland-server xkbcommon lua` src/Input.cpp src/Layout.cpp src/Lua.cpp src/Overview.cpp src/Render.cpp src/main.cpp -o Hyprspace.so
[root@8cbf798e614a Hyprspace]#

@ImanolBarba

Copy link
Copy Markdown
Author

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

git clone https://github.com/ImanolBarba/Hyprspace.git
cd Hyprspace
make all 

Did you checkout the pr branch? Or just main?

@0xl30

0xl30 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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

git clone https://github.com/ImanolBarba/Hyprspace.git
cd Hyprspace
make all 

Did you checkout the pr branch? Or just main?

main branch

@ImanolBarba

Copy link
Copy Markdown
Author

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

git clone https://github.com/ImanolBarba/Hyprspace.git
cd Hyprspace
make all 

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:

git checkout migrate-v2
make all

LMK how it goes

@0xl30

0xl30 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

git clone https://github.com/ImanolBarba/Hyprspace.git

okay working add it hyprpm (for main branch)

@alba4k

alba4k commented Jul 21, 2026

Copy link
Copy Markdown

It works fine for me so it must be something on your end

for hyprpm, you can just hyprpm add https://.... [commit hash] and it'll find the commit even if it's not in the main branch

@0xl30

0xl30 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

It works fine for me so it must be something on your end

for hyprpm, you can just hyprpm add https://.... [commit hash] and it'll find the commit even if it's not in the main branch

yes working properly, i try to build from default (latest) branch instead of migrate-v2 then getting error

@ImanolBarba

Copy link
Copy Markdown
Author

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

@Azeajr

Azeajr commented Jul 25, 2026

Copy link
Copy Markdown

This builds on 0.56.0 but aborts the compositor the first time the overview is opened. src/Layout.cpp, three Config::Legacy::mgr().lock() calls the migration left untouched:

Assertion failed: impl_->lockable() (tried to lock a CWeakPointer over a CUniquePointer)
  @ hyprutils/memory/WeakPtr.hpp:181
#11 CHyprspaceWidget::updateLayout()
#12 CHyprspaceWidget::show()

mgr() returns a WP over a UP and hyprutils asserts on lock() for that pair. It only fires when overrideGaps and affectStrut are both enabled — both default on.

I'd skip patching the lock(), because hyprwm/Hyprland#15539 deletes the legacy config system outright, handleWorkspaceRules included. That call was only ever a detour anyway: handleWorkspaceRules parses the config line straight back into a CWorkspaceRule and calls Config::workspaceRuleMgr()->replaceOrAdd(). Building the rule directly fixes the crash and works on both 0.56.0 and current main — workspaceRuleMgr() and CWorkspaceRule are unchanged between them.

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 *PGAPSIN / *PGAPSOUT directly instead of formatting and reparsing them.

Unrelated nit while I was in there: targetWindow->layoutBox().pos() = targetPos; (src/Input.cpp:63) assigns to a temporary — layoutBox() and CBox::pos() both return by value, so it's a no-op and the move() on the next line does the work.

Tested on Arch hyprland 0.56.0-2, hyprutils 0.14.0-1, this PR's head, loaded into a nested instance with an otherwise default config.

@ImanolBarba

Copy link
Copy Markdown
Author

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

@ImanolBarba

Copy link
Copy Markdown
Author

Oh and thanks for the very detailed analysis here btw

@ImanolBarba

Copy link
Copy Markdown
Author

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!

@Petar546

Copy link
Copy Markdown

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

OS: NixOS 26.11.20260726.624af66 (Zokor)
Hyprland Version: 0.56.0 (Commit 36b2e0cfe0c6094dbc47bd42a437431315bb3087)
Build Flags: nix

Libraries:
- Hyprgraphics: 0.5.1
- Hyprutils: 0.14.0
- Hyprcursor: 0.1.13
- Hyprlang: 0.6.8
- Aquamarine: 0.13.0

@ImanolBarba

Copy link
Copy Markdown
Author

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

@ImanolBarba

Copy link
Copy Markdown
Author

Seems to work fine here

2026-07-28.16-58-00.mp4

@ImanolBarba

Copy link
Copy Markdown
Author

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

@ImanolBarba

Copy link
Copy Markdown
Author

I just tested on 0.55 (before the fullscreen refactor) and it behaves exactly like the video above

@alba4k

alba4k commented Jul 28, 2026

Copy link
Copy Markdown

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 hyprpm add https://...../Hyprspace <commit hash>)

@ImanolBarba

Copy link
Copy Markdown
Author

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

@Petar546

Petar546 commented Aug 16, 2026

Copy link
Copy Markdown

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

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:

  • Waybar reappearance
    with plugin settings as
  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 hideRealLayers, waybar properly disappears when overview is toggled on, but renders on each consecutive switch of workspace.

P.S. there may be missing README config explanations for panelBaseColor, if that is required to be in the explanations even.

@ImanolBarba

Copy link
Copy Markdown
Author

@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

@Petar546

Copy link
Copy Markdown

@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.
The waybar issues appear when using the provided config for the plugin, where the hideRealLayers is on true

@ImanolBarba

Copy link
Copy Markdown
Author

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

@ImanolBarba

Copy link
Copy Markdown
Author

@KZDKM any chance for a review?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants