diff options
author | Vaxry <[email protected]> | 2024-03-02 15:25:32 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-03-02 15:25:32 +0000 |
commit | 8811f4b69ade469285635c539f20194d717c8e17 (patch) | |
tree | cc48dbe53020d03aecd7c154a9e215720d1cfe3b /src/managers/XWaylandManager.cpp | |
parent | 52db21660801ef4300a8b3c5dbb5c7e244ed2d19 (diff) | |
download | Hyprland-8811f4b69ade469285635c539f20194d717c8e17.tar.gz Hyprland-8811f4b69ade469285635c539f20194d717c8e17.zip |
drag: check min size for reisze drags
fixes #4920
Diffstat (limited to 'src/managers/XWaylandManager.cpp')
-rw-r--r-- | src/managers/XWaylandManager.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index f70022cf..4e01d724 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -321,6 +321,21 @@ Vector2D CHyprXWaylandManager::getMaxSizeForWindow(CWindow* pWindow) { return MAXSIZE; } +Vector2D CHyprXWaylandManager::getMinSizeForWindow(CWindow* pWindow) { + if (!g_pCompositor->windowValidMapped(pWindow)) + return Vector2D(0, 0); + + if ((pWindow->m_bIsX11 && !pWindow->m_uSurface.xwayland->size_hints) || (!pWindow->m_bIsX11 && !pWindow->m_uSurface.xdg->toplevel)) + return Vector2D(0, 0); + + auto MINSIZE = pWindow->m_bIsX11 ? Vector2D(pWindow->m_uSurface.xwayland->size_hints->min_width, pWindow->m_uSurface.xwayland->size_hints->min_height) : + Vector2D(pWindow->m_uSurface.xdg->toplevel->current.min_width, pWindow->m_uSurface.xdg->toplevel->current.min_height); + + MINSIZE = MINSIZE.clamp({1, 1}); + + return MINSIZE; +} + Vector2D CHyprXWaylandManager::xwaylandToWaylandCoords(const Vector2D& coord) { static auto* const PXWLFORCESCALEZERO = (Hyprlang::INT* const*)g_pConfigManager->getConfigValuePtr("xwayland:force_zero_scaling"); |