diff --git a/hyprwinwrap/main.cpp b/hyprwinwrap/main.cpp index ea42deb..59ad8d9 100644 --- a/hyprwinwrap/main.cpp +++ b/hyprwinwrap/main.cpp @@ -7,18 +7,16 @@ #include #include -#define protected public #define private public #include #include -#include +#include #include #include #include #include #include #undef private -#undef protected #include #include "globals.hpp" @@ -127,13 +125,13 @@ void onRenderStage(eRenderStage stage) { for (auto& bg : bgWindows) { const auto bgw = bg.lock(); - if (bgw->m_monitor != g_pHyprRenderer->renderData().pMonitor) + if (bgw->m_monitor != g_pHyprOpenGL->m_renderData.pMonitor) continue; // cant use setHidden cuz that sends suspended and shit too that would be laggy bgw->m_hidden = false; - g_pHyprRenderer->renderWindow(bgw, g_pHyprRenderer->renderData().pMonitor.lock(), Time::steadyNow(), false, Render::RENDER_PASS_ALL, false, true); + g_pHyprRenderer->renderWindow(bgw, g_pHyprOpenGL->m_renderData.pMonitor.lock(), Time::steadyNow(), false, RENDER_PASS_ALL, false, true); bgw->m_hidden = true; } @@ -152,7 +150,7 @@ void onCommitSubsurface(Desktop::View::CSubsurface* thisptr) { ((origCommitSubsurface)subsurfaceHook->m_original)(thisptr); if (const auto MON = PWINDOW->m_monitor.lock(); MON) - MON->m_blurFBDirty = true; + g_pHyprOpenGL->markBlurDirtyForMonitor(MON); PWINDOW->m_hidden = true; } @@ -170,25 +168,24 @@ void onCommit(void* owner, void* data) { ((origCommit)commitHook->m_original)(owner, data); if (const auto MON = PWINDOW->m_monitor.lock(); MON) - MON->m_blurFBDirty = true; + g_pHyprOpenGL->markBlurDirtyForMonitor(MON); PWINDOW->m_hidden = true; } void onConfigReloaded() { - WP mgr = dynamicPointerCast(WP(Config::mgr())); static auto* const PCLASS = (Hyprlang::STRING const*)HyprlandAPI::getConfigValue(PHANDLE, "plugin:hyprwinwrap:class")->getDataStaticPtr(); const std::string classRule(*PCLASS); if (!classRule.empty()) { - mgr->parseKeyword("windowrulev2", std::string{"float, class:^("} + classRule + ")$"); - mgr->parseKeyword("windowrulev2", std::string{"size 100\% 100\%, class:^("} + classRule + ")$"); + g_pConfigManager->parseKeyword("windowrulev2", std::string{"float, class:^("} + classRule + ")$"); + g_pConfigManager->parseKeyword("windowrulev2", std::string{"size 100\% 100\%, class:^("} + classRule + ")$"); } static auto* const PTITLE = (Hyprlang::STRING const*)HyprlandAPI::getConfigValue(PHANDLE, "plugin:hyprwinwrap:title")->getDataStaticPtr(); const std::string titleRule(*PTITLE); if (!titleRule.empty()) { - mgr->parseKeyword("windowrulev2", std::string{"float, title:^("} + titleRule + ")$"); - mgr->parseKeyword("windowrulev2", std::string{"size 100\% 100\%, title:^("} + titleRule + ")$"); + g_pConfigManager->parseKeyword("windowrulev2", std::string{"float, title:^("} + titleRule + ")$"); + g_pConfigManager->parseKeyword("windowrulev2", std::string{"size 100\% 100\%, title:^("} + titleRule + ")$"); } }