summaryrefslogtreecommitdiff
path: root/src/managers/XWaylandManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-08-05 18:10:59 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-08-05 18:10:59 +0200
commitcd37a1533e0e86fffdd333e18bab0bb730c1dc25 (patch)
treefb32becc5c231a19b80fb911a8d60a1ce41869b1 /src/managers/XWaylandManager.cpp
parent575434f1a4cfce30cf89b62e5f1cce4b3c326b6e (diff)
reject tiling windows that do not meet the max size requirement
Diffstat (limited to 'src/managers/XWaylandManager.cpp')
-rw-r--r--src/managers/XWaylandManager.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp
index 11e32917..5688a849 100644
--- a/src/managers/XWaylandManager.cpp
+++ b/src/managers/XWaylandManager.cpp
@@ -230,4 +230,16 @@ void CHyprXWaylandManager::setWindowFullscreen(CWindow* pWindow, bool fullscreen
if (pWindow->m_phForeignToplevel)
wlr_foreign_toplevel_handle_v1_set_fullscreen(pWindow->m_phForeignToplevel, fullscreen);
-} \ No newline at end of file
+}
+
+Vector2D CHyprXWaylandManager::getMaxSizeForWindow(CWindow* pWindow) {
+ auto MAXSIZE = pWindow->m_bIsX11 ? Vector2D(pWindow->m_uSurface.xwayland->size_hints->max_width, pWindow->m_uSurface.xwayland->size_hints->max_height)
+ : Vector2D(pWindow->m_uSurface.xdg->toplevel->current.max_width, pWindow->m_uSurface.xdg->toplevel->current.max_height);
+
+ if (MAXSIZE.x < 5)
+ MAXSIZE.x = 99999;
+ if (MAXSIZE.y < 5)
+ MAXSIZE.y = 99999;
+
+ return MAXSIZE;
+}