@@ -71,8 +71,8 @@ void CPopup::initAllSignals() {
71
71
if (!m_pWLR) {
72
72
if (!m_pWindowOwner.expired ())
73
73
hyprListener_newPopup.initCallback (&m_pWindowOwner.lock ()->m_uSurface .xdg ->events .new_popup , ::onNewPopup, this , " CPopup Head" );
74
- else if (m_pLayerOwner)
75
- hyprListener_newPopup.initCallback (&m_pLayerOwner->layerSurface ->events .new_popup , ::onNewPopup, this , " CPopup Head" );
74
+ else if (! m_pLayerOwner. expired () )
75
+ hyprListener_newPopup.initCallback (&m_pLayerOwner. lock () ->layerSurface ->events .new_popup , ::onNewPopup, this , " CPopup Head" );
76
76
else
77
77
ASSERT (false );
78
78
@@ -119,8 +119,8 @@ void CPopup::onMap() {
119
119
unconstrain ();
120
120
sendScale ();
121
121
122
- if (m_pLayerOwner && m_pLayerOwner->layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)
123
- g_pHyprOpenGL->markBlurDirtyForMonitor (g_pCompositor->getMonitorFromID (m_pLayerOwner->layer ));
122
+ if (! m_pLayerOwner. expired () && m_pLayerOwner. lock () ->layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)
123
+ g_pHyprOpenGL->markBlurDirtyForMonitor (g_pCompositor->getMonitorFromID (m_pLayerOwner. lock () ->layer ));
124
124
}
125
125
126
126
void CPopup::onUnmap () {
@@ -136,8 +136,8 @@ void CPopup::onUnmap() {
136
136
137
137
g_pInputManager->simulateMouseMovement ();
138
138
139
- if (m_pLayerOwner && m_pLayerOwner->layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)
140
- g_pHyprOpenGL->markBlurDirtyForMonitor (g_pCompositor->getMonitorFromID (m_pLayerOwner->layer ));
139
+ if (! m_pLayerOwner. expired () && m_pLayerOwner. lock () ->layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)
140
+ g_pHyprOpenGL->markBlurDirtyForMonitor (g_pCompositor->getMonitorFromID (m_pLayerOwner. lock () ->layer ));
141
141
}
142
142
143
143
void CPopup::onCommit (bool ignoreSiblings) {
@@ -178,8 +178,8 @@ void CPopup::onCommit(bool ignoreSiblings) {
178
178
179
179
m_bRequestedReposition = false ;
180
180
181
- if (m_pLayerOwner && m_pLayerOwner->layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)
182
- g_pHyprOpenGL->markBlurDirtyForMonitor (g_pCompositor->getMonitorFromID (m_pLayerOwner->layer ));
181
+ if (! m_pLayerOwner. expired () && m_pLayerOwner. lock () ->layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)
182
+ g_pHyprOpenGL->markBlurDirtyForMonitor (g_pCompositor->getMonitorFromID (m_pLayerOwner. lock () ->layer ));
183
183
}
184
184
185
185
void CPopup::onReposition () {
@@ -232,8 +232,8 @@ Vector2D CPopup::localToGlobal(const Vector2D& rel) {
232
232
Vector2D CPopup::t1ParentCoords () {
233
233
if (!m_pWindowOwner.expired ())
234
234
return m_pWindowOwner.lock ()->m_vRealPosition .value ();
235
- if (m_pLayerOwner)
236
- return m_pLayerOwner->realPosition .value ();
235
+ if (! m_pLayerOwner. expired () )
236
+ return m_pLayerOwner. lock () ->realPosition .value ();
237
237
238
238
ASSERT (false );
239
239
return {};
@@ -262,8 +262,19 @@ Vector2D CPopup::size() {
262
262
void CPopup::sendScale () {
263
263
if (!m_pWindowOwner.expired ())
264
264
g_pCompositor->setPreferredScaleForSurface (m_sWLSurface.wlr (), m_pWindowOwner.lock ()->m_pWLSurface .m_fLastScale );
265
- else if (m_pLayerOwner)
266
- g_pCompositor->setPreferredScaleForSurface (m_sWLSurface.wlr (), m_pLayerOwner->surface .m_fLastScale );
265
+ else if (! m_pLayerOwner. expired () )
266
+ g_pCompositor->setPreferredScaleForSurface (m_sWLSurface.wlr (), m_pLayerOwner. lock () ->surface .m_fLastScale );
267
267
else
268
268
UNREACHABLE ();
269
269
}
270
+
271
+ bool CPopup::visible () {
272
+ if (!m_pWindowOwner.expired ())
273
+ return g_pHyprRenderer->shouldRenderWindow (m_pWindowOwner.lock ());
274
+ if (!m_pLayerOwner.expired ())
275
+ return true ;
276
+ if (m_pParent)
277
+ return m_pParent->visible ();
278
+
279
+ return false ;
280
+ }
0 commit comments