mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-10 11:45:57 +01:00
parent
5edfa627b4
commit
60571cd5cc
2 changed files with 14 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include "CHyprBorderDecoration.hpp"
|
#include "CHyprBorderDecoration.hpp"
|
||||||
#include "../../Compositor.hpp"
|
#include "../../Compositor.hpp"
|
||||||
#include "../../config/ConfigValue.hpp"
|
#include "../../config/ConfigValue.hpp"
|
||||||
|
#include "../../managers/eventLoop/EventLoopManager.hpp"
|
||||||
|
|
||||||
CHyprBorderDecoration::CHyprBorderDecoration(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow) {
|
CHyprBorderDecoration::CHyprBorderDecoration(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow) {
|
||||||
m_pWindow = pWindow;
|
m_pWindow = pWindow;
|
||||||
|
@ -82,8 +83,17 @@ eDecorationType CHyprBorderDecoration::getDecorationType() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHyprBorderDecoration::updateWindow(PHLWINDOW) {
|
void CHyprBorderDecoration::updateWindow(PHLWINDOW) {
|
||||||
if (m_pWindow->getRealBorderSize() != m_seExtents.topLeft.x)
|
auto borderSize = m_pWindow->getRealBorderSize();
|
||||||
g_pDecorationPositioner->repositionDeco(this);
|
|
||||||
|
if (borderSize == m_iLastBorderSize)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (borderSize <= 0 && m_iLastBorderSize <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_iLastBorderSize = borderSize;
|
||||||
|
|
||||||
|
g_pEventLoopManager->doLater([this]() { g_pDecorationPositioner->repositionDeco(this); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHyprBorderDecoration::damageEntire() {
|
void CHyprBorderDecoration::damageEntire() {
|
||||||
|
|
|
@ -36,6 +36,8 @@ class CHyprBorderDecoration : public IHyprWindowDecoration {
|
||||||
|
|
||||||
CBox m_bAssignedGeometry = {0};
|
CBox m_bAssignedGeometry = {0};
|
||||||
|
|
||||||
|
int m_iLastBorderSize = -1;
|
||||||
|
|
||||||
CBox assignedBoxGlobal();
|
CBox assignedBoxGlobal();
|
||||||
bool doesntWantBorders();
|
bool doesntWantBorders();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue