[client] wayland: xdg handles resizable

Added missing resizable functionality to xdg_shellInit
when win:allowResize is set to true
This commit is contained in:
Jonathan Rubenstein
2025-07-11 20:29:11 +03:00
committed by Geoffrey McRae
parent f7e0b9746a
commit 3f35b0b0af

View File

@@ -49,6 +49,7 @@ typedef struct XDGState
uint32_t resizeSerial; uint32_t resizeSerial;
bool fullscreen; bool fullscreen;
bool floating; bool floating;
bool resizable;
int displayFd; int displayFd;
} }
XDGState; XDGState;
@@ -155,6 +156,13 @@ bool xdg_shellInit(struct wl_display * display, struct wl_surface * surface,
if (maximize) if (maximize)
xdg_toplevel_set_maximized(state.toplevel); xdg_toplevel_set_maximized(state.toplevel);
if (!resizable)
{
xdg_toplevel_set_min_size(state.toplevel, state.width, state.height);
xdg_toplevel_set_max_size(state.toplevel, state.width, state.height);
}
state.resizable = resizable;
if (state.decorationManager) if (state.decorationManager)
{ {
state.toplevelDecoration = zxdg_decoration_manager_v1_get_toplevel_decoration( state.toplevelDecoration = zxdg_decoration_manager_v1_get_toplevel_decoration(
@@ -200,7 +208,7 @@ static void xdg_minimize(void)
static void xdg_shellResize(int w, int h) static void xdg_shellResize(int w, int h)
{ {
if (!state.floating) if (!state.floating || !state.resizable)
return; return;
state.width = w; state.width = w;