popup: imorove logging, use fadeAlpha for opacity

This commit is contained in:
Vaxry 2025-08-03 16:39:54 +02:00
parent 61826dc7ac
commit f6d8e86439
No known key found for this signature in database
GPG key ID: 665806380871D640
2 changed files with 12 additions and 2 deletions

View file

@ -90,7 +90,7 @@ void CPopup::initAllSignals() {
void CPopup::onNewPopup(SP<CXDGPopupResource> 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)};