From f6d8e86439473a5df84cbf1106dafee517f535b0 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 3 Aug 2025 16:39:54 +0200 Subject: [PATCH] popup: imorove logging, use fadeAlpha for opacity --- src/desktop/Popup.cpp | 6 +++++- src/render/Renderer.cpp | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/desktop/Popup.cpp b/src/desktop/Popup.cpp index cf97cf3d..34c88350 100644 --- a/src/desktop/Popup.cpp +++ b/src/desktop/Popup.cpp @@ -90,7 +90,7 @@ void CPopup::initAllSignals() { void CPopup::onNewPopup(SP popup) { const auto& POPUP = m_children.emplace_back(CPopup::create(popup, m_self)); POPUP->m_self = POPUP; - Debug::log(LOG, "New popup at {:x}", (uintptr_t)POPUP); + Debug::log(LOG, "New popup at {:x}", (uintptr_t)this); } void CPopup::onDestroy() { @@ -148,6 +148,8 @@ void CPopup::onMap() { m_alpha->setValueAndWarp(0.F); *m_alpha = 1.F; + + Debug::log(LOG, "popup {:x}: mapped", (uintptr_t)this); } void CPopup::onUnmap() { @@ -160,6 +162,8 @@ void CPopup::onUnmap() { return; } + Debug::log(LOG, "popup {:x}: unmapped", (uintptr_t)this); + // if the popup committed a different size right now, we also need to damage the old size. const Vector2D MAX_DAMAGE_SIZE = {std::max(m_lastSize.x, m_resource->m_surface->m_surface->m_current.size.x), std::max(m_lastSize.y, m_resource->m_surface->m_surface->m_current.size.y)}; diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 62bec442..cb6bd264 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -664,7 +664,7 @@ void CHyprRenderer::renderWindow(PHLWINDOW pWindow, PHLMONITOR pMonitor, const T const auto pos = popup->coordsRelativeToParent(); const Vector2D oldPos = renderdata.pos; renderdata.pos += pos; - renderdata.alpha = popup->m_alpha->value(); + renderdata.fadeAlpha = popup->m_alpha->value(); popup->m_wlSurface->resource()->breadthfirst( [this, &renderdata](SP s, const Vector2D& offset, void* data) { @@ -2416,6 +2416,8 @@ void CHyprRenderer::makeSnapshot(PHLWINDOW pWindow) { if (!shouldRenderWindow(pWindow)) return; // ignore, window is not being rendered + Debug::log(LOG, "renderer: making a snapshot of {:x}", (uintptr_t)pWindow.get()); + // we need to "damage" the entire monitor // so that we render the entire window // this is temporary, doesn't mess with the actual damage @@ -2449,6 +2451,8 @@ void CHyprRenderer::makeSnapshot(PHLLS pLayer) { if (!PMONITOR || !PMONITOR->m_output || PMONITOR->m_pixelSize.x <= 0 || PMONITOR->m_pixelSize.y <= 0) return; + Debug::log(LOG, "renderer: making a snapshot of {:x}", (uintptr_t)pLayer.get()); + // we need to "damage" the entire monitor // so that we render the entire window // this is temporary, doesn't mess with the actual damage @@ -2484,6 +2488,8 @@ void CHyprRenderer::makeSnapshot(WP popup) { if (!popup->m_wlSurface || !popup->m_wlSurface->resource() || !popup->m_mapped) return; + Debug::log(LOG, "renderer: making a snapshot of {:x}", (uintptr_t)popup.get()); + CRegion fakeDamage{0, 0, PMONITOR->m_transformedSize.x, PMONITOR->m_transformedSize.y}; makeEGLCurrent();