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
This commit is contained in:
Jonas Ådahl
2026-03-30 11:48:35 +02:00
committed by Camilla Löwy
parent e94108d9db
commit ed6452b13c
+10 -2
View File
@@ -986,6 +986,8 @@ static GLFWbool createLibdecorFrame(_GLFWwindow* window)
libdecor_frame_set_title(window->wl.libdecor.frame, window->title); libdecor_frame_set_title(window->wl.libdecor.frame, window->title);
if (window->resizable)
{
if (window->minwidth != GLFW_DONT_CARE && if (window->minwidth != GLFW_DONT_CARE &&
window->minheight != GLFW_DONT_CARE) window->minheight != GLFW_DONT_CARE)
{ {
@@ -1001,11 +1003,17 @@ static GLFWbool createLibdecorFrame(_GLFWwindow* window)
window->maxwidth, window->maxwidth,
window->maxheight); window->maxheight);
} }
}
if (!window->resizable) else
{ {
libdecor_frame_unset_capabilities(window->wl.libdecor.frame, libdecor_frame_unset_capabilities(window->wl.libdecor.frame,
LIBDECOR_ACTION_RESIZE); 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) if (window->monitor)