From ca17a89d86b73f37019c4cc0c7087303adbcc1f9 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Mon, 25 Mar 2024 16:08:55 +0000 Subject: renderer: allow blurring ls popups --- src/desktop/Popup.cpp | 9 +++++++++ src/desktop/Window.cpp | 10 ++++++++++ src/desktop/Window.hpp | 1 + 3 files changed, 20 insertions(+) (limited to 'src/desktop') diff --git a/src/desktop/Popup.cpp b/src/desktop/Popup.cpp index 98d5881a..77e486fd 100644 --- a/src/desktop/Popup.cpp +++ b/src/desktop/Popup.cpp @@ -117,6 +117,9 @@ void CPopup::onMap() { unconstrain(); sendScale(); + + if (m_pLayerOwner && m_pLayerOwner->layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP) + g_pHyprOpenGL->markBlurDirtyForMonitor(g_pCompositor->getMonitorFromID(m_pLayerOwner->layer)); } void CPopup::onUnmap() { @@ -131,6 +134,9 @@ void CPopup::onUnmap() { m_pSubsurfaceHead.reset(); g_pInputManager->simulateMouseMovement(); + + if (m_pLayerOwner && m_pLayerOwner->layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP) + g_pHyprOpenGL->markBlurDirtyForMonitor(g_pCompositor->getMonitorFromID(m_pLayerOwner->layer)); } void CPopup::onCommit(bool ignoreSiblings) { @@ -158,6 +164,9 @@ void CPopup::onCommit(bool ignoreSiblings) { g_pHyprRenderer->damageSurface(m_sWLSurface.wlr(), COORDS.x, COORDS.y); m_bRequestedReposition = false; + + if (m_pLayerOwner && m_pLayerOwner->layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP) + g_pHyprOpenGL->markBlurDirtyForMonitor(g_pCompositor->getMonitorFromID(m_pLayerOwner->layer)); } void CPopup::onReposition() { diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index 3145000c..9151d57e 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -1151,3 +1151,13 @@ void CWindow::setAnimationsToMove() { m_vRealSize.setConfig(PANIMCFG); m_bAnimatingIn = false; } + +int CWindow::popupsCount() { + if (m_bIsX11) + return 1; + + int no = 0; + wlr_xdg_surface_for_each_popup_surface( + m_uSurface.xdg, [](wlr_surface* s, int x, int y, void* data) { *(int*)data += 1; }, &no); + return no; +} diff --git a/src/desktop/Window.hpp b/src/desktop/Window.hpp index 3ec8a54c..d8b4012d 100644 --- a/src/desktop/Window.hpp +++ b/src/desktop/Window.hpp @@ -404,6 +404,7 @@ class CWindow { void onBorderAngleAnimEnd(void* ptr); bool isInCurvedCorner(double x, double y); bool hasPopupAt(const Vector2D& pos); + int popupsCount(); void applyGroupRules(); void createGroup(); -- cgit v1.2.3