diff --git a/src/Window.hpp b/src/Window.hpp index ffa447fc..e63eba65 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -51,6 +51,10 @@ public: CAnimatedVariable m_vRealPosition; CAnimatedVariable m_vRealSize; + // for not spamming the protocols + Vector2D m_vReportedPosition; + Vector2D m_vReportedSize; + // this is used for pseudotiling bool m_bIsPseudotiled = false; Vector2D m_vPseudoSize = Vector2D(0,0); diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index a0bd0b65..f6587acb 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -598,7 +598,7 @@ void Events::listener_newXDGSurface(wl_listener* listener, void* data) { Debug::log(LOG, "New XDG Surface created. (class: %s)", XDGSURFACE->toplevel->app_id); if (XDGSURFACE->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL) - return; // TODO: handle? + return; const auto PNEWWINDOW = g_pCompositor->m_vWindows.emplace_back(std::make_unique()).get(); PNEWWINDOW->m_uSurface.xdg = XDGSURFACE; diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index 6ba2fa34..11e32917 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -121,6 +121,13 @@ void CHyprXWaylandManager::sendCloseWindow(CWindow* pWindow) { } void CHyprXWaylandManager::setWindowSize(CWindow* pWindow, const Vector2D& size) { + + if ((pWindow->m_vReportedSize == size && pWindow->m_vRealPosition.vec() == pWindow->m_vReportedPosition) || (pWindow->m_vReportedSize == size && !pWindow->m_bIsX11)) + return; + + pWindow->m_vReportedPosition = pWindow->m_vRealPosition.vec(); + pWindow->m_vReportedSize = size; + if (pWindow->m_bIsX11) wlr_xwayland_surface_configure(pWindow->m_uSurface.xwayland, pWindow->m_vRealPosition.vec().x, pWindow->m_vRealPosition.vec().y, size.x, size.y); else