diff --git a/.gitignore b/.gitignore index a389e7d..00436c6 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,6 @@ # Nix result result-man + +build/ +.cache/ \ No newline at end of file diff --git a/borders-plus-plus/borderDeco.cpp b/borders-plus-plus/borderDeco.cpp index 2479939..9a2abfa 100644 --- a/borders-plus-plus/borderDeco.cpp +++ b/borders-plus-plus/borderDeco.cpp @@ -1,7 +1,7 @@ #include "borderDeco.hpp" #include -#include +#include #include #include using namespace Hyprutils::Memory; diff --git a/borders-plus-plus/main.cpp b/borders-plus-plus/main.cpp index c43d25e..1cfa532 100644 --- a/borders-plus-plus/main.cpp +++ b/borders-plus-plus/main.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include diff --git a/csgo-vulkan-fix/main.cpp b/csgo-vulkan-fix/main.cpp index 37944e3..3e820bc 100644 --- a/csgo-vulkan-fix/main.cpp +++ b/csgo-vulkan-fix/main.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include #include @@ -21,7 +21,7 @@ inline CFunctionHook* g_pSurfaceSizeHook = nullptr; inline CFunctionHook* g_pWLSurfaceDamageHook = nullptr; typedef void (*origMotion)(CSeatManager*, uint32_t, const Vector2D&); typedef void (*origSurfaceSize)(CXWaylandSurface*, const CBox&); -typedef CRegion (*origWLSurfaceDamage)(CWLSurface*); +typedef CRegion (*origWLSurfaceDamage)(Desktop::View::CWLSurface*); // Do NOT change this function. APICALL EXPORT std::string PLUGIN_API_VERSION() { @@ -83,24 +83,25 @@ void hkSetWindowSize(CXWaylandSurface* surface, const CBox& box) { newBox.w = CONFIG->res.x; newBox.h = CONFIG->res.y; - CWLSurface::fromResource(SURF)->m_fillIgnoreSmall = true; + Desktop::View::CWLSurface::fromResource(SURF)->m_fillIgnoreSmall = true; } (*(origSurfaceSize)g_pSurfaceSizeHook->m_original)(surface, newBox); } -CRegion hkWLSurfaceDamage(CWLSurface* thisptr) { +CRegion hkWLSurfaceDamage(Desktop::View::CWLSurface* thisptr) { const auto RG = (*(origWLSurfaceDamage)g_pWLSurfaceDamageHook->m_original)(thisptr); - if (thisptr->exists() && thisptr->getWindow()) { - const auto CONFIG = getAppConfig(thisptr->getWindow()->m_initialClass); + if (thisptr->exists() && Desktop::View::CWindow::fromView(thisptr->view())) { + const auto WINDOW = Desktop::View::CWindow::fromView(thisptr->view()); + const auto CONFIG = getAppConfig(WINDOW->m_initialClass); if (CONFIG) { - const auto PMONITOR = thisptr->getWindow()->m_monitor.lock(); + const auto PMONITOR = WINDOW->m_monitor.lock(); if (PMONITOR) g_pHyprRenderer->damageMonitor(PMONITOR); else - g_pHyprRenderer->damageWindow(thisptr->getWindow()); + g_pHyprRenderer->damageWindow(WINDOW); } } diff --git a/hyprbars/barDeco.cpp b/hyprbars/barDeco.cpp index 5eb9fa7..77640bf 100644 --- a/hyprbars/barDeco.cpp +++ b/hyprbars/barDeco.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include #include @@ -86,10 +86,10 @@ bool CHyprBar::inputIsValid() { return false; if (!m_pWindow->m_workspace || !m_pWindow->m_workspace->isVisible() || !g_pInputManager->m_exclusiveLSes.empty() || - (g_pSeatManager->m_seatGrab && !g_pSeatManager->m_seatGrab->accepts(m_pWindow->m_wlSurface->resource()))) + (g_pSeatManager->m_seatGrab && !g_pSeatManager->m_seatGrab->accepts(m_pWindow->wlSurface()->resource()))) return false; - const auto WINDOWATCURSOR = g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING); + const auto WINDOWATCURSOR = g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), Desktop::View::RESERVED_EXTENTS | Desktop::View::INPUT_EXTENTS | Desktop::View::ALLOW_FLOATING); auto focusState = Desktop::focusState(); auto window = focusState->window(); diff --git a/hyprbars/main.cpp b/hyprbars/main.cpp index 0da8aa6..22c9d1f 100644 --- a/hyprbars/main.cpp +++ b/hyprbars/main.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include #include diff --git a/hyprexpo/main.cpp b/hyprexpo/main.cpp index 7b0a42d..883fd82 100644 --- a/hyprexpo/main.cpp +++ b/hyprexpo/main.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include #include diff --git a/hyprscrolling/Scrolling.cpp b/hyprscrolling/Scrolling.cpp index 4ff5116..6aa8a16 100644 --- a/hyprscrolling/Scrolling.cpp +++ b/hyprscrolling/Scrolling.cpp @@ -538,7 +538,7 @@ void CScrollingLayout::onWindowCreatedTiling(PHLWINDOW window, eDirection direct auto droppingOn = Desktop::focusState()->window(); if (droppingOn == window) - droppingOn = g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), RESERVED_EXTENTS | INPUT_EXTENTS); + droppingOn = g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), Desktop::View::RESERVED_EXTENTS | Desktop::View::INPUT_EXTENTS); SP droppingData = droppingOn ? dataFor(droppingOn) : nullptr; SP droppingColumn = droppingData ? droppingData->column.lock() : nullptr; diff --git a/hyprscrolling/main.cpp b/hyprscrolling/main.cpp index b6425d0..990c05d 100644 --- a/hyprscrolling/main.cpp +++ b/hyprscrolling/main.cpp @@ -7,7 +7,7 @@ #define private public #include -#include +#include #include #include #include diff --git a/hyprtrails/main.cpp b/hyprtrails/main.cpp index 73aa00a..76201a8 100644 --- a/hyprtrails/main.cpp +++ b/hyprtrails/main.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include #include diff --git a/hyprtrails/trail.cpp b/hyprtrails/trail.cpp index 7bf4f31..2e33343 100644 --- a/hyprtrails/trail.cpp +++ b/hyprtrails/trail.cpp @@ -1,7 +1,7 @@ #include "trail.hpp" #include -#include +#include #include #include using namespace Hyprutils::Memory; diff --git a/hyprwinwrap/main.cpp b/hyprwinwrap/main.cpp index 6d66cba..5f75880 100644 --- a/hyprwinwrap/main.cpp +++ b/hyprwinwrap/main.cpp @@ -9,7 +9,7 @@ #define private public #include -#include +#include #include #include #include @@ -27,7 +27,7 @@ APICALL EXPORT std::string PLUGIN_API_VERSION() { // hooks inline CFunctionHook* subsurfaceHook = nullptr; inline CFunctionHook* commitHook = nullptr; -typedef void (*origCommitSubsurface)(CSubsurface* thisptr); +typedef void (*origCommitSubsurface)(Desktop::View::CSubsurface* thisptr); typedef void (*origCommit)(void* owner, void* data); std::vector bgWindows; @@ -132,8 +132,8 @@ void onRenderStage(eRenderStage stage) { } } -void onCommitSubsurface(CSubsurface* thisptr) { - const auto PWINDOW = thisptr->m_wlSurface->getWindow(); +void onCommitSubsurface(Desktop::View::CSubsurface* thisptr) { + const auto PWINDOW = Desktop::View::CWindow::fromView(thisptr->wlSurface()->view()); if (!PWINDOW || std::find_if(bgWindows.begin(), bgWindows.end(), [PWINDOW](const auto& ref) { return ref.lock() == PWINDOW; }) == bgWindows.end()) { ((origCommitSubsurface)subsurfaceHook->m_original)(thisptr); @@ -151,7 +151,7 @@ void onCommitSubsurface(CSubsurface* thisptr) { } void onCommit(void* owner, void* data) { - const auto PWINDOW = ((CWindow*)owner)->m_self.lock(); + const auto PWINDOW = ((Desktop::View::CWindow*)owner)->m_self.lock(); if (std::find_if(bgWindows.begin(), bgWindows.end(), [PWINDOW](const auto& ref) { return ref.lock() == PWINDOW; }) == bgWindows.end()) { ((origCommit)commitHook->m_original)(owner, data); @@ -203,16 +203,12 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) { static auto P4 = HyprlandAPI::registerCallbackDynamic(PHANDLE, "configReloaded", [&](void* self, SCallbackInfo& info, std::any data) { onConfigReloaded(); }); // clang-format on - auto fns = HyprlandAPI::findFunctionsByName(PHANDLE, "onCommit"); + auto fns = HyprlandAPI::findFunctionsByName(PHANDLE, "_ZN7Desktop4View11CSubsurface8onCommitEv"); if (fns.size() < 1) throw std::runtime_error("hyprwinwrap: onCommit not found"); - for (auto& fn : fns) { - if (!fn.demangled.contains("CSubsurface")) - continue; - subsurfaceHook = HyprlandAPI::createFunctionHook(PHANDLE, fn.address, (void*)&onCommitSubsurface); - } + subsurfaceHook = HyprlandAPI::createFunctionHook(PHANDLE, fns[0].address, (void*)&onCommitSubsurface); - fns = HyprlandAPI::findFunctionsByName(PHANDLE, "listener_commitWindow"); + fns = HyprlandAPI::findFunctionsByName(PHANDLE, "_ZN7Desktop4View7CWindow12commitWindowEv"); if (fns.size() < 1) throw std::runtime_error("hyprwinwrap: listener_commitWindow not found"); commitHook = HyprlandAPI::createFunctionHook(PHANDLE, fns[0].address, (void*)&onCommit); diff --git a/xtra-dispatchers/main.cpp b/xtra-dispatchers/main.cpp index 848076b..103d537 100644 --- a/xtra-dispatchers/main.cpp +++ b/xtra-dispatchers/main.cpp @@ -8,7 +8,7 @@ #define private public #include #include -#include +#include #include #include #include