From b0ab8afc589a2575268d30048c18886cf842d13b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 28 Jul 2022 15:40:06 +0200 Subject: [PATCH] fix some XWayland weird popups --- src/events/Windows.cpp | 10 ++++++++++ src/layout/IHyprLayout.cpp | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 91840d3f..a0bd0b65 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -517,6 +517,11 @@ void Events::listener_configureX11(void* owner, void* data) { return; } + if (E->width > 1 && E->height > 1) + PWINDOW->m_bHidden = false; + else + PWINDOW->m_bHidden = true; + PWINDOW->m_vRealPosition.setValueAndWarp(Vector2D(E->x, E->y)); PWINDOW->m_vRealSize.setValueAndWarp(Vector2D(E->width, E->height)); PWINDOW->m_vPosition = PWINDOW->m_vRealPosition.vec(); @@ -544,6 +549,11 @@ void Events::listener_unmanagedSetGeometry(void* owner, void* data) { const auto POS = PWINDOW->m_vRealPosition.goalv(); const auto SIZ = PWINDOW->m_vRealSize.goalv(); + if (PWINDOW->m_uSurface.xwayland->width > 1 && PWINDOW->m_uSurface.xwayland->height > 1) + PWINDOW->m_bHidden = false; + else + PWINDOW->m_bHidden = true; + if (abs(std::floor(POS.x) - PWINDOW->m_uSurface.xwayland->x) > 2 || abs(std::floor(POS.y) - PWINDOW->m_uSurface.xwayland->y) > 2 || abs(std::floor(SIZ.x) - PWINDOW->m_uSurface.xwayland->width) > 2 || abs(std::floor(SIZ.y) - PWINDOW->m_uSurface.xwayland->height) > 2) { Debug::log(LOG, "Unmanaged window %x requests geometry update to %i %i %i %i", PWINDOW, (int)PWINDOW->m_uSurface.xwayland->x, (int)PWINDOW->m_uSurface.xwayland->y, (int)PWINDOW->m_uSurface.xwayland->width, (int)PWINDOW->m_uSurface.xwayland->height); diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 0032c7fc..d9dc50c0 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -35,6 +35,11 @@ void IHyprLayout::onWindowCreatedFloating(CWindow* pWindow) { if (desiredGeometry.width <= 5 || desiredGeometry.height <= 5) { const auto PWINDOWSURFACE = g_pXWaylandManager->getWindowSurface(pWindow); pWindow->m_vRealSize = Vector2D(PWINDOWSURFACE->current.width, PWINDOWSURFACE->current.height); + + if (desiredGeometry.width <= 1 || desiredGeometry.height <= 1) { + pWindow->m_bHidden = true; + return; + } // reject any windows with size <= 5x5 if (pWindow->m_vRealSize.goalv().x <= 5 || pWindow->m_vRealSize.goalv().y <= 5) {