From 118d9a086e87655d3207e42ac1aed8eca7920694 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 28 May 2021 20:16:22 +1000 Subject: [PATCH] [client] x11: implement `win:noResize` This is the final fix for #506 --- client/displayservers/X11/x11.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/client/displayservers/X11/x11.c b/client/displayservers/X11/x11.c index e557f3b0..7902446f 100644 --- a/client/displayservers/X11/x11.c +++ b/client/displayservers/X11/x11.c @@ -171,15 +171,25 @@ static bool x11Init(const LG_DSInitParams params) free(hint.res_name); free(hint.res_class); + XSizeHints *xsh = XAllocSizeHints(); if (params.center) { - XSizeHints *xsh = XAllocSizeHints(); - xsh->flags = PWinGravity; + xsh->flags |= PWinGravity; xsh->win_gravity = 5; //Center - XSetWMNormalHints(x11.display, x11.window, xsh); - XFree(xsh); } + if (!params.resizable) + { + xsh->flags |= PMinSize | PMaxSize; + xsh->min_width = params.w; + xsh->max_width = params.w; + xsh->min_height = params.h; + xsh->max_height = params.h; + } + + XSetWMNormalHints(x11.display, x11.window, xsh); + XFree(xsh); + X11AtomsInit(); XSetWMProtocols(x11.display, x11.window, &x11atoms.WM_DELETE_WINDOW, 1);