diff --git a/src/Window.cpp b/src/Window.cpp index 789882de..58ec5c72 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -2,6 +2,7 @@ #include "Compositor.hpp" #include "render/decorations/CHyprDropShadowDecoration.hpp" #include "render/decorations/CHyprGroupBarDecoration.hpp" +#include "render/decorations/CHyprBorderDecoration.hpp" CWindow::CWindow() { m_vRealPosition.create(AVARTYPE_VECTOR, g_pConfigManager->getAnimationPropertyConfig("windowsIn"), (void*)this, AVARDAMAGE_ENTIRE); @@ -14,6 +15,7 @@ CWindow::CWindow() { m_fDimPercent.create(AVARTYPE_FLOAT, g_pConfigManager->getAnimationPropertyConfig("fadeDim"), (void*)this, AVARDAMAGE_ENTIRE); addWindowDeco(std::make_unique(this)); + addWindowDeco(std::make_unique(this)); } CWindow::~CWindow() { @@ -964,7 +966,7 @@ float CWindow::rounding() { float rounding = m_sAdditionalConfigData.rounding.toUnderlying() == -1 ? *PROUNDING : m_sAdditionalConfigData.rounding.toUnderlying(); - return rounding; + return m_sSpecialRenderData.rounding ? rounding : 0; } void CWindow::updateSpecialRenderData() { diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 71841804..e5eb4cdb 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -80,6 +80,7 @@ void CConfigManager::setDefaultVars() { configValues["general:apply_sens_to_raw"].intValue = 0; configValues["general:border_size"].intValue = 1; configValues["general:no_border_on_floating"].intValue = 0; + configValues["general:border_part_of_window"].intValue = 1; configValues["general:gaps_in"].intValue = 5; configValues["general:gaps_out"].intValue = 20; configValues["general:gaps_workspaces"].intValue = 0; diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 2ee70264..ff68d13f 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -506,14 +506,6 @@ void Events::listener_mapWindow(void* owner, void* data) { "XWayland Window Late"); } - // do the animation thing - g_pAnimationManager->onWindowPostCreateClose(PWINDOW, false); - PWINDOW->m_fAlpha.setValueAndWarp(0.f); - PWINDOW->m_fAlpha = 1.f; - - PWINDOW->m_vRealPosition.setCallbackOnEnd(setAnimToMove); - PWINDOW->m_vRealSize.setCallbackOnEnd(setAnimToMove); - if ((requestsFullscreen && (!PWINDOW->m_bNoFullscreenRequest || overridingNoFullscreen)) || (requestsMaximize && (!PWINDOW->m_bNoMaximizeRequest || overridingNoMaximize)) || requestsFakeFullscreen) { // fix fullscreen on requested (basically do a switcheroo) @@ -627,6 +619,19 @@ void Events::listener_mapWindow(void* owner, void* data) { g_pEventManager->postEvent(SHyprIPCEvent{"openwindow", std::format("{:x},{},{},{}", PWINDOW, workspaceID, g_pXWaylandManager->getAppIDClass(PWINDOW), PWINDOW->m_szTitle)}); EMIT_HOOK_EVENT("openWindow", PWINDOW); + // apply data from default decos. Borders, shadows. + g_pDecorationPositioner->forceRecalcFor(PWINDOW); + PWINDOW->updateWindowDecos(); + g_pLayoutManager->getCurrentLayout()->recalculateWindow(PWINDOW); + + // do animations + g_pAnimationManager->onWindowPostCreateClose(PWINDOW, false); + PWINDOW->m_fAlpha.setValueAndWarp(0.f); + PWINDOW->m_fAlpha = 1.f; + + PWINDOW->m_vRealPosition.setCallbackOnEnd(setAnimToMove); + PWINDOW->m_vRealSize.setCallbackOnEnd(setAnimToMove); + // recalc the values for this window g_pCompositor->updateWindowAnimatedDecorationValues(PWINDOW); // avoid this window being visible diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index a01c3b8c..c1009a47 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -149,24 +149,20 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for PWINDOW->m_sSpecialRenderData.rounding = false; PWINDOW->m_sSpecialRenderData.shadow = false; + PWINDOW->updateWindowDecos(); + const auto RESERVED = PWINDOW->getFullWindowReservedArea(); - const int BORDERSIZE = PWINDOW->getRealBorderSize(); - - PWINDOW->m_vRealPosition = PWINDOW->m_vPosition + Vector2D(BORDERSIZE, BORDERSIZE) + RESERVED.topLeft; - PWINDOW->m_vRealSize = PWINDOW->m_vSize - Vector2D(2 * BORDERSIZE, 2 * BORDERSIZE) - (RESERVED.topLeft + RESERVED.bottomRight); - - PWINDOW->updateWindowDecos(); + PWINDOW->m_vRealPosition = PWINDOW->m_vPosition + RESERVED.topLeft; + PWINDOW->m_vRealSize = PWINDOW->m_vSize - (RESERVED.topLeft + RESERVED.bottomRight); g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.goalv()); return; } - const int BORDERSIZE = PWINDOW->getRealBorderSize(); - - auto calcPos = PWINDOW->m_vPosition + Vector2D(BORDERSIZE, BORDERSIZE); - auto calcSize = PWINDOW->m_vSize - Vector2D(2 * BORDERSIZE, 2 * BORDERSIZE); + auto calcPos = PWINDOW->m_vPosition; + auto calcSize = PWINDOW->m_vSize; const auto OFFSETTOPLEFT = Vector2D(DISPLAYLEFT ? gapsOut : gapsIn, DISPLAYTOP ? gapsOut : gapsIn); diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index 3977d8f6..8b12d669 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -667,24 +667,20 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) { PWINDOW->m_sSpecialRenderData.rounding = false; PWINDOW->m_sSpecialRenderData.shadow = false; + PWINDOW->updateWindowDecos(); + const auto RESERVED = PWINDOW->getFullWindowReservedArea(); - const int BORDERSIZE = PWINDOW->getRealBorderSize(); - - PWINDOW->m_vRealPosition = PWINDOW->m_vPosition + Vector2D(BORDERSIZE, BORDERSIZE) + RESERVED.topLeft; - PWINDOW->m_vRealSize = PWINDOW->m_vSize - Vector2D(2 * BORDERSIZE, 2 * BORDERSIZE) - (RESERVED.topLeft + RESERVED.bottomRight); - - PWINDOW->updateWindowDecos(); + PWINDOW->m_vRealPosition = PWINDOW->m_vPosition + RESERVED.topLeft; + PWINDOW->m_vRealSize = PWINDOW->m_vSize - (RESERVED.topLeft + RESERVED.bottomRight); g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.goalv()); return; } - const int BORDERSIZE = PWINDOW->getRealBorderSize(); - - auto calcPos = PWINDOW->m_vPosition + Vector2D(BORDERSIZE, BORDERSIZE); - auto calcSize = PWINDOW->m_vSize - Vector2D(2 * BORDERSIZE, 2 * BORDERSIZE); + auto calcPos = PWINDOW->m_vPosition; + auto calcSize = PWINDOW->m_vSize; const auto OFFSETTOPLEFT = Vector2D(DISPLAYLEFT ? gapsOut : gapsIn, DISPLAYTOP ? gapsOut : gapsIn); diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index 3d6ebdd8..120e6f49 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -229,6 +229,8 @@ void CAnimationManager::tick() { case AVARDAMAGE_BORDER: { RASSERT(PWINDOW, "Tried to AVARDAMAGE_BORDER a non-window AVAR!"); + // TODO: move this to the border class + // damage only the border. static auto* const PROUNDING = &g_pConfigManager->getConfigValuePtr("decoration:rounding")->intValue; const auto ROUNDINGSIZE = *PROUNDING + 1; diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 08765849..6731dff5 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -381,11 +381,10 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec* TRACY_GPU_ZONE("RenderWindow"); - const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID); - const auto REALPOS = pWindow->m_vRealPosition.vec() + (pWindow->m_bPinned ? Vector2D{} : PWORKSPACE->m_vRenderOffset.vec()); - static auto* const PDIMAROUND = &g_pConfigManager->getConfigValuePtr("decoration:dim_around")->floatValue; - static auto* const PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue; - static auto* const PBLUR = &g_pConfigManager->getConfigValuePtr("decoration:blur:enabled")->intValue; + const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID); + const auto REALPOS = pWindow->m_vRealPosition.vec() + (pWindow->m_bPinned ? Vector2D{} : PWORKSPACE->m_vRenderOffset.vec()); + static auto* const PDIMAROUND = &g_pConfigManager->getConfigValuePtr("decoration:dim_around")->floatValue; + static auto* const PBLUR = &g_pConfigManager->getConfigValuePtr("decoration:blur:enabled")->intValue; SRenderData renderdata = {pMonitor, time}; CBox textureBox = {REALPOS.x, REALPOS.y, std::max(pWindow->m_vRealSize.vec().x, 5.0), std::max(pWindow->m_vRealSize.vec().y, 5.0)}; @@ -512,32 +511,6 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec* g_pHyprOpenGL->m_RenderData.useNearestNeighbor = false; - if (renderdata.decorate && pWindow->m_sSpecialRenderData.border) { - auto grad = g_pHyprOpenGL->m_pCurrentWindow->m_cRealBorderColor; - const bool ANIMATED = g_pHyprOpenGL->m_pCurrentWindow->m_fBorderFadeAnimationProgress.isBeingAnimated(); - float a1 = renderdata.fadeAlpha * renderdata.alpha * (ANIMATED ? g_pHyprOpenGL->m_pCurrentWindow->m_fBorderFadeAnimationProgress.fl() : 1.f); - - if (g_pHyprOpenGL->m_pCurrentWindow->m_fBorderAngleAnimationProgress.getConfig()->pValues->internalEnabled) { - grad.m_fAngle += g_pHyprOpenGL->m_pCurrentWindow->m_fBorderAngleAnimationProgress.fl() * M_PI * 2; - grad.m_fAngle = normalizeAngleRad(grad.m_fAngle); - } - - CBox windowBox = {renderdata.x - pMonitor->vecPosition.x, renderdata.y - pMonitor->vecPosition.y, renderdata.w, renderdata.h}; - - windowBox.scale(pMonitor->scale).round(); - - int borderSize = pWindow->m_sSpecialRenderData.borderSize.toUnderlying() == -1 ? *PBORDERSIZE : pWindow->m_sSpecialRenderData.borderSize.toUnderlying(); - if (pWindow->m_sAdditionalConfigData.borderSize.toUnderlying() != -1) - borderSize = pWindow->m_sAdditionalConfigData.borderSize.toUnderlying(); - - g_pHyprOpenGL->renderBorder(&windowBox, grad, renderdata.rounding, borderSize, a1); - - if (ANIMATED) { - float a2 = renderdata.fadeAlpha * renderdata.alpha * (1.f - g_pHyprOpenGL->m_pCurrentWindow->m_fBorderFadeAnimationProgress.fl()); - g_pHyprOpenGL->renderBorder(&windowBox, g_pHyprOpenGL->m_pCurrentWindow->m_cRealBorderColorPrevious, renderdata.rounding, borderSize, a2); - } - } - for (auto& wd : pWindow->m_dWindowDecorations) { if (wd->getDecorationLayer() != DECORATION_LAYER_OVER) continue; diff --git a/src/render/decorations/CHyprBorderDecoration.cpp b/src/render/decorations/CHyprBorderDecoration.cpp new file mode 100644 index 00000000..560eb8ca --- /dev/null +++ b/src/render/decorations/CHyprBorderDecoration.cpp @@ -0,0 +1,101 @@ +#include "CHyprBorderDecoration.hpp" +#include "../../Compositor.hpp" + +CHyprBorderDecoration::CHyprBorderDecoration(CWindow* pWindow) : IHyprWindowDecoration(pWindow) { + m_pWindow = pWindow; +} + +CHyprBorderDecoration::~CHyprBorderDecoration() { + ; +} + +SDecorationPositioningInfo CHyprBorderDecoration::getPositioningInfo() { + const auto BORDERSIZE = m_pWindow->getRealBorderSize(); + m_seExtents = {{BORDERSIZE, BORDERSIZE}, {BORDERSIZE, BORDERSIZE}}; + + if (doesntWantBorders()) + m_seExtents = {{}, {}}; + + SDecorationPositioningInfo info; + info.priority = 10000; + info.policy = DECORATION_POSITION_STICKY; + info.desiredExtents = m_seExtents; + info.reserved = true; + info.edges = DECORATION_EDGE_BOTTOM | DECORATION_EDGE_LEFT | DECORATION_EDGE_RIGHT | DECORATION_EDGE_TOP; + + m_seReportedExtents = m_seExtents; + return info; +} + +void CHyprBorderDecoration::onPositioningReply(const SDecorationPositioningReply& reply) { + m_bAssignedGeometry = reply.assignedGeometry; +} + +CBox CHyprBorderDecoration::assignedBoxGlobal() { + CBox box = m_bAssignedGeometry; + box.translate(g_pDecorationPositioner->getEdgeDefinedPoint(DECORATION_EDGE_BOTTOM | DECORATION_EDGE_LEFT | DECORATION_EDGE_RIGHT | DECORATION_EDGE_TOP, m_pWindow)); + + const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(m_pWindow->m_iWorkspaceID); + + if (!PWORKSPACE) + return box; + + const auto WORKSPACEOFFSET = PWORKSPACE && !m_pWindow->m_bPinned ? PWORKSPACE->m_vRenderOffset.vec() : Vector2D(); + return box.translate(WORKSPACEOFFSET); +} + +void CHyprBorderDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& offset) { + if (doesntWantBorders()) + return; + + if (m_bAssignedGeometry.width < m_seExtents.topLeft.x + 1 || m_bAssignedGeometry.height < m_seExtents.topLeft.y + 1) + return; + + auto grad = m_pWindow->m_cRealBorderColor; + const bool ANIMATED = m_pWindow->m_fBorderFadeAnimationProgress.isBeingAnimated(); + float a1 = a * (ANIMATED ? m_pWindow->m_fBorderFadeAnimationProgress.fl() : 1.f); + + if (m_pWindow->m_fBorderAngleAnimationProgress.getConfig()->pValues->internalEnabled) { + grad.m_fAngle += m_pWindow->m_fBorderAngleAnimationProgress.fl() * M_PI * 2; + grad.m_fAngle = normalizeAngleRad(grad.m_fAngle); + } + + CBox windowBox = assignedBoxGlobal().translate(-pMonitor->vecPosition).expand(-m_pWindow->getRealBorderSize()).scale(pMonitor->scale).round(); + + int borderSize = m_pWindow->getRealBorderSize(); + const auto ROUNDING = m_pWindow->rounding() * pMonitor->scale; + + g_pHyprOpenGL->renderBorder(&windowBox, grad, ROUNDING, borderSize, a1); + + if (ANIMATED) { + float a2 = a * (1.f - m_pWindow->m_fBorderFadeAnimationProgress.fl()); + g_pHyprOpenGL->renderBorder(&windowBox, m_pWindow->m_cRealBorderColorPrevious, ROUNDING, borderSize, a2); + } +} + +eDecorationType CHyprBorderDecoration::getDecorationType() { + return DECORATION_BORDER; +} + +void CHyprBorderDecoration::updateWindow(CWindow*) { + if (m_pWindow->getRealBorderSize() != m_seExtents.topLeft.x) + g_pDecorationPositioner->repositionDeco(this); +} + +void CHyprBorderDecoration::damageEntire() { + ; // ignored, done in animationManager. todo, move. +} + +eDecorationLayer CHyprBorderDecoration::getDecorationLayer() { + return DECORATION_LAYER_OVER; +} + +uint64_t CHyprBorderDecoration::getDecorationFlags() { + static auto* const PPARTOFWINDOW = &g_pConfigManager->getConfigValuePtr("general:border_part_of_window")->intValue; + + return *PPARTOFWINDOW && !doesntWantBorders() ? DECORATION_PART_OF_MAIN_WINDOW : 0; +} + +bool CHyprBorderDecoration::doesntWantBorders() { + return !m_pWindow->m_sSpecialRenderData.border || m_pWindow->m_bX11DoesntWantBorders; +} \ No newline at end of file diff --git a/src/render/decorations/CHyprBorderDecoration.hpp b/src/render/decorations/CHyprBorderDecoration.hpp new file mode 100644 index 00000000..770d1291 --- /dev/null +++ b/src/render/decorations/CHyprBorderDecoration.hpp @@ -0,0 +1,39 @@ +#pragma once + +#include "IHyprWindowDecoration.hpp" + +class CHyprBorderDecoration : public IHyprWindowDecoration { + public: + CHyprBorderDecoration(CWindow*); + virtual ~CHyprBorderDecoration(); + + virtual SDecorationPositioningInfo getPositioningInfo(); + + virtual void onPositioningReply(const SDecorationPositioningReply& reply); + + virtual void draw(CMonitor*, float a, const Vector2D& offset); + + virtual eDecorationType getDecorationType(); + + virtual void updateWindow(CWindow*); + + virtual void damageEntire(); + + virtual eDecorationLayer getDecorationLayer(); + + virtual uint64_t getDecorationFlags(); + + private: + SWindowDecorationExtents m_seExtents; + SWindowDecorationExtents m_seReportedExtents; + + CWindow* m_pWindow = nullptr; + + Vector2D m_vLastWindowPos; + Vector2D m_vLastWindowSize; + + CBox m_bAssignedGeometry = {0}; + + CBox assignedBoxGlobal(); + bool doesntWantBorders(); +}; \ No newline at end of file diff --git a/src/render/decorations/CHyprDropShadowDecoration.cpp b/src/render/decorations/CHyprDropShadowDecoration.cpp index bbf6def4..5e70b639 100644 --- a/src/render/decorations/CHyprDropShadowDecoration.cpp +++ b/src/render/decorations/CHyprDropShadowDecoration.cpp @@ -116,13 +116,13 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a, const Vector2D CBox withDecos = m_bLastWindowBoxWithDecos; // get window box - windowBox.translate(-pMonitor->vecPosition + WORKSPACEOFFSET).scale(pMonitor->scale).round(); - withDecos.translate(-pMonitor->vecPosition + WORKSPACEOFFSET).scale(pMonitor->scale).round(); + windowBox.translate(-pMonitor->vecPosition + WORKSPACEOFFSET); + withDecos.translate(-pMonitor->vecPosition + WORKSPACEOFFSET); - auto scaledDecoExtents = withDecos.extentsFrom(windowBox).round(); + auto extentss = withDecos.extentsFrom(windowBox); // add extents - windowBox.addExtents(scaledDecoExtents).round(); + windowBox.addExtents(extentss).scale(pMonitor->scale).round(); if (windowBox.width < 1 || windowBox.height < 1) return; // prevent assert failed @@ -159,7 +159,7 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a, const Vector2D g_pHyprOpenGL->m_RenderData.damage = saveDamage; } else { - g_pHyprOpenGL->renderRoundedShadow(&fullBox, ROUNDING * pMonitor->scale, *PSHADOWSIZE * pMonitor->scale, a); + g_pHyprOpenGL->renderRoundedShadow(&fullBox, ROUNDING * pMonitor->scale, *PSHADOWSIZE * pMonitor->scale, m_pWindow->m_cRealShadowColor.col(), a); } if (m_seExtents != m_seReportedExtents) diff --git a/src/render/decorations/DecorationPositioner.cpp b/src/render/decorations/DecorationPositioner.cpp index b41b92a9..30e49ac1 100644 --- a/src/render/decorations/DecorationPositioner.cpp +++ b/src/render/decorations/DecorationPositioner.cpp @@ -21,14 +21,15 @@ Vector2D CDecorationPositioner::getEdgeDefinedPoint(uint32_t edges, CWindow* pWi const int EDGESNO = TOP + BOTTOM + LEFT + RIGHT; - if (EDGESNO == 0 || EDGESNO > 2) { + if (EDGESNO == 0 || EDGESNO == 3 || EDGESNO > 4) { Debug::log(ERR, "getEdgeDefinedPoint: invalid number of edges"); return {}; } - CBox wb = pWindow->getWindowMainSurfaceBox(); - const auto BORDERSIZE = pWindow->getRealBorderSize(); - wb.expand(BORDERSIZE); + CBox wb = pWindow->getWindowMainSurfaceBox(); + + if (EDGESNO == 4) + return wb.pos(); if (EDGESNO == 1) { if (TOP) @@ -137,9 +138,7 @@ void CDecorationPositioner::onWindowUpdate(CWindow* pWindow) { std::sort(datas.begin(), datas.end(), [](const auto& a, const auto& b) { return a->positioningInfo.priority > b->positioningInfo.priority; }); - CBox wb = pWindow->getWindowMainSurfaceBox(); - const auto BORDERSIZE = pWindow->getRealBorderSize(); - wb.expand(BORDERSIZE); + CBox wb = pWindow->getWindowMainSurfaceBox(); // calc reserved float reservedXL = 0, reservedYT = 0, reservedXR = 0, reservedYB = 0; @@ -199,7 +198,7 @@ void CDecorationPositioner::onWindowUpdate(CWindow* pWindow) { } if (wd->positioningInfo.policy == DECORATION_POSITION_STICKY) { - if (EDGESNO != 1) { + if (EDGESNO != 1 && EDGESNO != 4) { wd->lastReply = {}; wd->pDecoration->onPositioningReply({}); continue; @@ -219,7 +218,15 @@ void CDecorationPositioner::onWindowUpdate(CWindow* pWindow) { Vector2D pos, size; - if (LEFT) { + if (EDGESNO == 4) { + pos = wb.pos() - EDGEPOINT - Vector2D{stickyOffsetXL + desiredSize, stickyOffsetYT + desiredSize}; + size = wb.size() + Vector2D{stickyOffsetXL + stickyOffsetXR + desiredSize * 2, stickyOffsetYB + stickyOffsetYT + desiredSize * 2}; + + stickyOffsetXL += desiredSize; + stickyOffsetXR += desiredSize; + stickyOffsetYT += desiredSize; + stickyOffsetYB += desiredSize; + } else if (LEFT) { pos = wb.pos() - EDGEPOINT - Vector2D{stickyOffsetXL, 0}; pos.x -= desiredSize; size = {desiredSize, wb.size().y}; @@ -279,7 +286,7 @@ SWindowDecorationExtents CDecorationPositioner::getWindowDecorationReserved(CWin } SWindowDecorationExtents CDecorationPositioner::getWindowDecorationExtents(CWindow* pWindow, bool inputOnly) { - CBox accum = pWindow->getWindowMainSurfaceBox().expand(pWindow->getRealBorderSize()); + CBox accum = pWindow->getWindowMainSurfaceBox(); for (auto& data : m_vWindowPositioningDatas) { if (data->pWindow != pWindow) @@ -320,7 +327,7 @@ SWindowDecorationExtents CDecorationPositioner::getWindowDecorationExtents(CWind } CBox CDecorationPositioner::getBoxWithIncludedDecos(CWindow* pWindow) { - CBox accum = pWindow->getWindowMainSurfaceBox().expand(pWindow->getRealBorderSize()); + CBox accum = pWindow->getWindowMainSurfaceBox(); for (auto& data : m_vWindowPositioningDatas) { if (data->pWindow != pWindow) @@ -347,9 +354,9 @@ CBox CDecorationPositioner::getBoxWithIncludedDecos(CWindow* pWindow) { if (decoBox.y < accum.y) extentsToAdd.topLeft.y = accum.y - decoBox.y; if (decoBox.x + decoBox.w > accum.x + accum.w) - extentsToAdd.bottomRight.x = accum.x + accum.w - (decoBox.x + decoBox.w); + extentsToAdd.bottomRight.x = (decoBox.x + decoBox.w) - (accum.x + accum.w); if (decoBox.y + decoBox.h > accum.y + accum.h) - extentsToAdd.bottomRight.y = accum.y + accum.h - (decoBox.y + decoBox.h); + extentsToAdd.bottomRight.y = (decoBox.y + decoBox.h) - (accum.y + accum.h); accum.addExtents(extentsToAdd); } diff --git a/src/render/decorations/IHyprWindowDecoration.hpp b/src/render/decorations/IHyprWindowDecoration.hpp index 15b00536..e0a34016 100644 --- a/src/render/decorations/IHyprWindowDecoration.hpp +++ b/src/render/decorations/IHyprWindowDecoration.hpp @@ -8,6 +8,7 @@ enum eDecorationType { DECORATION_NONE = -1, DECORATION_GROUPBAR, DECORATION_SHADOW, + DECORATION_BORDER, DECORATION_CUSTOM };