popup: send scale on map

fixes #4972
This commit is contained in:
Vaxry 2024-03-05 20:42:22 +00:00
parent 0ee69058c4
commit a4c1f4a03d
2 changed files with 11 additions and 0 deletions

View file

@ -116,6 +116,7 @@ void CPopup::onMap() {
m_pSubsurfaceHead = std::make_unique<CSubsurface>(this);
unconstrain();
sendScale();
}
void CPopup::onUnmap() {
@ -234,3 +235,12 @@ void CPopup::recheckChildrenRecursive() {
Vector2D CPopup::size() {
return m_vLastSize;
}
void CPopup::sendScale() {
if (m_pWindowOwner)
g_pCompositor->setPreferredScaleForSurface(m_sWLSurface.wlr(), m_pWindowOwner->m_pWLSurface.m_fLastScale);
else if (m_pLayerOwner)
g_pCompositor->setPreferredScaleForSurface(m_sWLSurface.wlr(), m_pLayerOwner->surface.m_fLastScale);
else
UNREACHABLE();
}

View file

@ -65,6 +65,7 @@ class CPopup {
void initAllSignals();
void unconstrain();
void recheckChildrenRecursive();
void sendScale();
Vector2D localToGlobal(const Vector2D& rel);
Vector2D t1ParentCoords();