From ac6bc07346c5ae9b3fe8a49635f22e471c8a84ec Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 10 Oct 2023 20:13:15 +0100 Subject: [PATCH] borders-plus-plus: update for hyprland --- borders-plus-plus/borderDeco.cpp | 6 +++--- borders-plus-plus/main.cpp | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/borders-plus-plus/borderDeco.cpp b/borders-plus-plus/borderDeco.cpp index cca25ea..cea8299 100644 --- a/borders-plus-plus/borderDeco.cpp +++ b/borders-plus-plus/borderDeco.cpp @@ -5,7 +5,7 @@ #include "globals.hpp" -CBordersPlusPlus::CBordersPlusPlus(CWindow* pWindow) : IHyprWindowDecoration(pWindow) { +CBordersPlusPlus::CBordersPlusPlus(CWindow* pWindow) : IHyprWindowDecoration(pWindow), m_pWindow(pWindow) { m_vLastWindowPos = pWindow->m_vRealPosition.vec(); m_vLastWindowSize = pWindow->m_vRealSize.vec(); } @@ -58,7 +58,7 @@ void CBordersPlusPlus::draw(CMonitor* pMonitor, float a, const Vector2D& offset) g_pHyprOpenGL->scissor((wlr_box*)nullptr); scaleBox(&fullBox, pMonitor->scale); - g_pHyprOpenGL->renderBorder(&fullBox, CColor(*PCOLOR1), *PROUNDING == 0 ? 0 : *PROUNDING * pMonitor->scale + *PBORDERSIZE * 2, a); + g_pHyprOpenGL->renderBorder(&fullBox, CColor(*PCOLOR1), *PROUNDING == 0 ? 0 : *PROUNDING * pMonitor->scale + *PBORDERSIZE * 2, *PBORDERSIZE, a); // pass 2 @@ -84,7 +84,7 @@ void CBordersPlusPlus::draw(CMonitor* pMonitor, float a, const Vector2D& offset) g_pHyprOpenGL->scissor((wlr_box*)nullptr); scaleBox(&fullBox, pMonitor->scale); - g_pHyprOpenGL->renderBorder(&fullBox, CColor(*PCOLOR2), *PROUNDING == 0 ? 0 : *PROUNDING * pMonitor->scale + *PBORDERSIZE * 4, a); + g_pHyprOpenGL->renderBorder(&fullBox, CColor(*PCOLOR2), *PROUNDING == 0 ? 0 : *PROUNDING * pMonitor->scale + *PBORDERSIZE * 4, *PBORDERSIZE, a); } eDecorationType CBordersPlusPlus::getDecorationType() { diff --git a/borders-plus-plus/main.cpp b/borders-plus-plus/main.cpp index 8f8a807..7b21285 100644 --- a/borders-plus-plus/main.cpp +++ b/borders-plus-plus/main.cpp @@ -19,6 +19,8 @@ void onNewWindow(void* self, std::any data) { // data is guaranteed auto* const PWINDOW = std::any_cast(data); + HyprlandAPI::addNotification(PHANDLE, "a", CColor{0.2, 1.0, 0.2, 1.0}, 2000); + HyprlandAPI::addWindowDecoration(PHANDLE, PWINDOW, new CBordersPlusPlus(PWINDOW)); } @@ -36,6 +38,8 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) { if (w->isHidden() || !w->m_bIsMapped) continue; + HyprlandAPI::addNotification(PHANDLE, "b", CColor{0.2, 1.0, 0.2, 1.0}, 2000); + HyprlandAPI::addWindowDecoration(PHANDLE, w.get(), new CBordersPlusPlus(w.get())); }