renderer/internal: stop using box pointers
in favor of const refs
This commit is contained in:
parent
16aeb24bc1
commit
e951011503
32 changed files with 252 additions and 264 deletions
|
|
@ -41,7 +41,7 @@ CHyprAnimationManager::CHyprAnimationManager() {
|
|||
}
|
||||
|
||||
template <Animable VarType>
|
||||
void updateVariable(CAnimatedVariable<VarType>& av, const float POINTY, bool warp = false) {
|
||||
static void updateVariable(CAnimatedVariable<VarType>& av, const float POINTY, bool warp = false) {
|
||||
if (warp || av.value() == av.goal()) {
|
||||
av.warp();
|
||||
return;
|
||||
|
|
@ -51,7 +51,7 @@ void updateVariable(CAnimatedVariable<VarType>& av, const float POINTY, bool war
|
|||
av.value() = av.begun() + DELTA * POINTY;
|
||||
}
|
||||
|
||||
void updateColorVariable(CAnimatedVariable<CHyprColor>& av, const float POINTY, bool warp) {
|
||||
static void updateColorVariable(CAnimatedVariable<CHyprColor>& av, const float POINTY, bool warp) {
|
||||
if (warp || av.value() == av.goal()) {
|
||||
av.warp();
|
||||
return;
|
||||
|
|
@ -137,7 +137,7 @@ static void handleUpdate(CAnimatedVariable<VarType>& av, bool warp) {
|
|||
// "some fucking layers miss 1 pixel???" -- vaxry
|
||||
CBox expandBox = CBox{PLAYER->realPosition->value(), PLAYER->realSize->value()};
|
||||
expandBox.expand(5);
|
||||
g_pHyprRenderer->damageBox(&expandBox);
|
||||
g_pHyprRenderer->damageBox(expandBox);
|
||||
|
||||
PMONITOR = g_pCompositor->getMonitorFromVector(PLAYER->realPosition->goal() + PLAYER->realSize->goal() / 2.F);
|
||||
if (!PMONITOR)
|
||||
|
|
@ -180,7 +180,7 @@ static void handleUpdate(CAnimatedVariable<VarType>& av, bool warp) {
|
|||
// some fucking layers miss 1 pixel???
|
||||
CBox expandBox = CBox{PLAYER->realPosition->value(), PLAYER->realSize->value()};
|
||||
expandBox.expand(5);
|
||||
g_pHyprRenderer->damageBox(&expandBox);
|
||||
g_pHyprRenderer->damageBox(expandBox);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ SP<Aquamarine::IBuffer> CPointerManager::renderHWCursorBuffer(SP<CPointerManager
|
|||
Debug::log(TRACE, "[pointer] monitor: {}, size: {}, hw buf: {}, scale: {:.2f}, monscale: {:.2f}, xbox: {}", state->monitor->szName, currentCursorImage.size, cursorSize,
|
||||
currentCursorImage.scale, state->monitor->scale, xbox.size());
|
||||
|
||||
g_pHyprOpenGL->renderTexture(texture, &xbox, 1.F);
|
||||
g_pHyprOpenGL->renderTexture(texture, xbox, 1.F);
|
||||
|
||||
g_pHyprOpenGL->end();
|
||||
glFlush();
|
||||
|
|
@ -730,7 +730,7 @@ void CPointerManager::damageIfSoftware() {
|
|||
continue;
|
||||
|
||||
if ((mw->softwareLocks > 0 || mw->hardwareFailed || g_pConfigManager->shouldUseSoftwareCursors()) && b.overlaps({mw->monitor->vecPosition, mw->monitor->vecSize})) {
|
||||
g_pHyprRenderer->damageBox(&b, mw->monitor->shouldSkipScheduleFrameOnMouseEvent());
|
||||
g_pHyprRenderer->damageBox(b, mw->monitor->shouldSkipScheduleFrameOnMouseEvent());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1143,7 +1143,7 @@ void CPointerManager::damageCursor(PHLMONITOR pMonitor) {
|
|||
if (b.empty())
|
||||
return;
|
||||
|
||||
g_pHyprRenderer->damageBox(&b);
|
||||
g_pHyprRenderer->damageBox(b);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,9 +76,11 @@ void CHyprXWaylandManager::activateWindow(PHLWINDOW pWindow, bool activate) {
|
|||
pWindow->m_pWorkspace->m_pLastFocusedWindow = pWindow;
|
||||
}
|
||||
|
||||
void CHyprXWaylandManager::getGeometryForWindow(PHLWINDOW pWindow, CBox* pbox) {
|
||||
CBox CHyprXWaylandManager::getGeometryForWindow(PHLWINDOW pWindow) {
|
||||
if (!pWindow)
|
||||
return;
|
||||
return {};
|
||||
|
||||
CBox box;
|
||||
|
||||
if (pWindow->m_bIsX11) {
|
||||
const auto SIZEHINTS = pWindow->m_pXWaylandSurface->sizeHints.get();
|
||||
|
|
@ -86,24 +88,26 @@ void CHyprXWaylandManager::getGeometryForWindow(PHLWINDOW pWindow, CBox* pbox) {
|
|||
if (SIZEHINTS && !pWindow->isX11OverrideRedirect()) {
|
||||
// WM_SIZE_HINTS' x,y,w,h is deprecated it seems.
|
||||
// Source: https://x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#wm_normal_hints_property
|
||||
pbox->x = pWindow->m_pXWaylandSurface->geometry.x;
|
||||
pbox->y = pWindow->m_pXWaylandSurface->geometry.y;
|
||||
box.x = pWindow->m_pXWaylandSurface->geometry.x;
|
||||
box.y = pWindow->m_pXWaylandSurface->geometry.y;
|
||||
|
||||
constexpr int ICCCM_USSize = 0x2;
|
||||
constexpr int ICCCM_PSize = 0x8;
|
||||
|
||||
if ((SIZEHINTS->flags & ICCCM_USSize) || (SIZEHINTS->flags & ICCCM_PSize)) {
|
||||
pbox->w = SIZEHINTS->base_width;
|
||||
pbox->h = SIZEHINTS->base_height;
|
||||
box.w = SIZEHINTS->base_width;
|
||||
box.h = SIZEHINTS->base_height;
|
||||
} else {
|
||||
pbox->w = pWindow->m_pXWaylandSurface->geometry.w;
|
||||
pbox->h = pWindow->m_pXWaylandSurface->geometry.h;
|
||||
box.w = pWindow->m_pXWaylandSurface->geometry.w;
|
||||
box.h = pWindow->m_pXWaylandSurface->geometry.h;
|
||||
}
|
||||
} else
|
||||
*pbox = pWindow->m_pXWaylandSurface->geometry;
|
||||
box = pWindow->m_pXWaylandSurface->geometry;
|
||||
|
||||
} else if (pWindow->m_pXDGSurface)
|
||||
*pbox = pWindow->m_pXDGSurface->current.geometry;
|
||||
box = pWindow->m_pXDGSurface->current.geometry;
|
||||
|
||||
return box;
|
||||
}
|
||||
|
||||
void CHyprXWaylandManager::sendCloseWindow(PHLWINDOW pWindow) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class CHyprXWaylandManager {
|
|||
SP<CWLSurfaceResource> getWindowSurface(PHLWINDOW);
|
||||
void activateSurface(SP<CWLSurfaceResource>, bool);
|
||||
void activateWindow(PHLWINDOW, bool);
|
||||
void getGeometryForWindow(PHLWINDOW, CBox*);
|
||||
CBox getGeometryForWindow(PHLWINDOW);
|
||||
void sendCloseWindow(PHLWINDOW);
|
||||
void setWindowFullscreen(PHLWINDOW, bool);
|
||||
bool shouldBeFloated(PHLWINDOW, bool pending = false);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ void CInputPopup::damageEntire() {
|
|||
return;
|
||||
}
|
||||
CBox box = globalBox();
|
||||
g_pHyprRenderer->damageBox(&box);
|
||||
g_pHyprRenderer->damageBox(box);
|
||||
}
|
||||
|
||||
void CInputPopup::damageSurface() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue