summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-28 23:55:00 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-28 23:55:00 +0200
commit233bad5011830923bd4fa72926415d0e5c7a2298 (patch)
treeabd3de5ec907011c0ae17f096a39447d5edcdf33 /src
parent0f19bd99f8bdd36aaaf5b20bc7fbfe23a5e379b9 (diff)
Spam the protocols less with resizes of XDG
Diffstat (limited to 'src')
-rw-r--r--src/Window.hpp4
-rw-r--r--src/events/Windows.cpp2
-rw-r--r--src/managers/XWaylandManager.cpp7
3 files changed, 12 insertions, 1 deletions
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<CWindow>()).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