[client] x11: implement win:noResize

This is the final fix for #506
This commit is contained in:
Geoffrey McRae 2021-05-28 20:16:22 +10:00
parent 77c2b895c6
commit 118d9a086e

View File

@ -171,14 +171,24 @@ static bool x11Init(const LG_DSInitParams params)
free(hint.res_name); free(hint.res_name);
free(hint.res_class); free(hint.res_class);
XSizeHints *xsh = XAllocSizeHints();
if (params.center) if (params.center)
{ {
XSizeHints *xsh = XAllocSizeHints(); xsh->flags |= PWinGravity;
xsh->flags = PWinGravity;
xsh->win_gravity = 5; //Center xsh->win_gravity = 5; //Center
}
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); XSetWMNormalHints(x11.display, x11.window, xsh);
XFree(xsh); XFree(xsh);
}
X11AtomsInit(); X11AtomsInit();
XSetWMProtocols(x11.display, x11.window, &x11atoms.WM_DELETE_WINDOW, 1); XSetWMProtocols(x11.display, x11.window, &x11atoms.WM_DELETE_WINDOW, 1);