mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-17 13:03:48 -07:00
internal: Window storage rework - part 1 (#5762)
* Window storage rework - part 1 * format * remove useless include * fix pch * format * fix crash in dwindle * fix vram leak * prefer .expired() for bool checks
This commit is contained in:
@@ -80,7 +80,7 @@ void CAnimationManager::tick() {
|
||||
const float SPENT = av->getPercent();
|
||||
|
||||
// window stuff
|
||||
const auto PWINDOW = (CWindow*)av->m_pWindow;
|
||||
PHLWINDOW PWINDOW = av->m_pWindow.lock();
|
||||
PHLWORKSPACE PWORKSPACE = av->m_pWorkspace.lock();
|
||||
const auto PLAYER = (SLayerSurface*)av->m_pLayer;
|
||||
CMonitor* PMONITOR = nullptr;
|
||||
@@ -121,19 +121,19 @@ void CAnimationManager::tick() {
|
||||
const CBox windowBoxNoOffset = w->getFullWindowBoundingBox();
|
||||
const CBox monitorBox = {PMONITOR->vecPosition, PMONITOR->vecSize};
|
||||
if (windowBoxNoOffset.intersection(monitorBox) != windowBoxNoOffset) // on edges between multiple monitors
|
||||
g_pHyprRenderer->damageWindow(w.get(), true);
|
||||
g_pHyprRenderer->damageWindow(w, true);
|
||||
}
|
||||
|
||||
if (PWORKSPACE->m_bIsSpecialWorkspace)
|
||||
g_pHyprRenderer->damageWindow(w.get(), true); // hack for special too because it can cross multiple monitors
|
||||
g_pHyprRenderer->damageWindow(w, true); // hack for special too because it can cross multiple monitors
|
||||
}
|
||||
|
||||
// damage any workspace window that is on any monitor
|
||||
for (auto& w : g_pCompositor->m_vWindows) {
|
||||
if (!g_pCompositor->windowValidMapped(w.get()) || w->m_pWorkspace != PWORKSPACE || w->m_bPinned)
|
||||
if (!validMapped(w) || w->m_pWorkspace != PWORKSPACE || w->m_bPinned)
|
||||
continue;
|
||||
|
||||
g_pHyprRenderer->damageWindow(w.get());
|
||||
g_pHyprRenderer->damageWindow(w);
|
||||
}
|
||||
} else if (PLAYER) {
|
||||
// "some fucking layers miss 1 pixel???" -- vaxry
|
||||
@@ -192,7 +192,7 @@ void CAnimationManager::tick() {
|
||||
default: UNREACHABLE();
|
||||
}
|
||||
// set size and pos if valid, but only if damage policy entire (dont if border for example)
|
||||
if (g_pCompositor->windowValidMapped(PWINDOW) && av->m_eDamagePolicy == AVARDAMAGE_ENTIRE && PWINDOW->m_iX11Type != 2)
|
||||
if (validMapped(PWINDOW) && av->m_eDamagePolicy == AVARDAMAGE_ENTIRE && PWINDOW->m_iX11Type != 2)
|
||||
g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.goal());
|
||||
|
||||
// check if we did not finish animating. If so, trigger onAnimationEnd.
|
||||
@@ -213,14 +213,14 @@ void CAnimationManager::tick() {
|
||||
g_pHyprRenderer->damageWindow(PWINDOW);
|
||||
} else if (PWORKSPACE) {
|
||||
for (auto& w : g_pCompositor->m_vWindows) {
|
||||
if (!g_pCompositor->windowValidMapped(w.get()) || w->m_pWorkspace != PWORKSPACE)
|
||||
if (!validMapped(w) || w->m_pWorkspace != PWORKSPACE)
|
||||
continue;
|
||||
|
||||
w->updateWindowDecos();
|
||||
|
||||
// damage any workspace window that is on any monitor
|
||||
if (!w->m_bPinned)
|
||||
g_pHyprRenderer->damageWindow(w.get());
|
||||
g_pHyprRenderer->damageWindow(w);
|
||||
}
|
||||
} else if (PLAYER) {
|
||||
if (PLAYER->layer == ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND || PLAYER->layer == ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM)
|
||||
@@ -304,7 +304,7 @@ bool CAnimationManager::bezierExists(const std::string& bezier) {
|
||||
//
|
||||
//
|
||||
|
||||
void CAnimationManager::animationPopin(CWindow* pWindow, bool close, float minPerc) {
|
||||
void CAnimationManager::animationPopin(PHLWINDOW pWindow, bool close, float minPerc) {
|
||||
const auto GOALPOS = pWindow->m_vRealPosition.goal();
|
||||
const auto GOALSIZE = pWindow->m_vRealSize.goal();
|
||||
|
||||
@@ -317,7 +317,7 @@ void CAnimationManager::animationPopin(CWindow* pWindow, bool close, float minPe
|
||||
}
|
||||
}
|
||||
|
||||
void CAnimationManager::animationSlide(CWindow* pWindow, std::string force, bool close) {
|
||||
void CAnimationManager::animationSlide(PHLWINDOW pWindow, std::string force, bool close) {
|
||||
pWindow->m_vRealSize.warp(false); // size we preserve in slide
|
||||
|
||||
const auto GOALPOS = pWindow->m_vRealPosition.goal();
|
||||
@@ -381,7 +381,7 @@ void CAnimationManager::animationSlide(CWindow* pWindow, std::string force, bool
|
||||
pWindow->m_vRealPosition = posOffset;
|
||||
}
|
||||
|
||||
void CAnimationManager::onWindowPostCreateClose(CWindow* pWindow, bool close) {
|
||||
void CAnimationManager::onWindowPostCreateClose(PHLWINDOW pWindow, bool close) {
|
||||
if (!close) {
|
||||
pWindow->m_vRealPosition.m_pConfig = g_pConfigManager->getAnimationPropertyConfig("windowsIn");
|
||||
pWindow->m_vRealSize.m_pConfig = g_pConfigManager->getAnimationPropertyConfig("windowsIn");
|
||||
|
Reference in New Issue
Block a user