From ed6452b13c76f7b4da216a9952bc7837aeb0f031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 30 Mar 2026 11:48:35 +0200 Subject: [PATCH] Wayland: Set the correct min/max size when non-resizable Libdecor is a thin wrapper around xdg_toplevel, and expects the same kind of information passed to it as if it was a xdg_toplevel. This includes the min/max size when non-resizable, which was set when using xdg_toplevel directly, but not when using libdecor. This fixes issues with min/max size missing when mapping a non-resizable window. Related to #2842 --- src/wl_window.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index 46f6d469..c6abe433 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -986,26 +986,34 @@ static GLFWbool createLibdecorFrame(_GLFWwindow* window) libdecor_frame_set_title(window->wl.libdecor.frame, window->title); - if (window->minwidth != GLFW_DONT_CARE && - window->minheight != GLFW_DONT_CARE) + if (window->resizable) { - libdecor_frame_set_min_content_size(window->wl.libdecor.frame, - window->minwidth, - window->minheight); - } + if (window->minwidth != GLFW_DONT_CARE && + window->minheight != GLFW_DONT_CARE) + { + libdecor_frame_set_min_content_size(window->wl.libdecor.frame, + window->minwidth, + window->minheight); + } - if (window->maxwidth != GLFW_DONT_CARE && - window->maxheight != GLFW_DONT_CARE) - { - libdecor_frame_set_max_content_size(window->wl.libdecor.frame, - window->maxwidth, - window->maxheight); + if (window->maxwidth != GLFW_DONT_CARE && + window->maxheight != GLFW_DONT_CARE) + { + libdecor_frame_set_max_content_size(window->wl.libdecor.frame, + window->maxwidth, + window->maxheight); + } } - - if (!window->resizable) + else { libdecor_frame_unset_capabilities(window->wl.libdecor.frame, LIBDECOR_ACTION_RESIZE); + libdecor_frame_set_min_content_size(window->wl.libdecor.frame, + window->wl.width, + window->wl.height); + libdecor_frame_set_max_content_size(window->wl.libdecor.frame, + window->wl.width, + window->wl.height); } if (window->monitor)