From 143861758f472340d887978f1afb1b1d3a5130bc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 13 Jul 2024 11:47:38 -0400 Subject: X11: Avoid setting PBaseSize hints for top-level windows By my reading of the spec, pugl's use of this hint was correct. However, many window managers break when it's set and use that size as the minimum (even when an actual minimum is set). This seems to be a bug based on a misreading of the spec which has been copy-pasted across many small window manager projects over the years. Not exposing the default size is unfortunate, but apparently nobody misses features based on it and there's nothing we can do about it here, so just deny the window manager the information entirely. The hint is still set for embedded views because (for example) plugin hosts need this information. --- src/x11.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/x11.c') diff --git a/src/x11.c b/src/x11.c index 419cd54..217838f 100644 --- a/src/x11.c +++ b/src/x11.c @@ -416,8 +416,9 @@ updateSizeHints(const PuglView* const view) sizeHints.max_width = (int)frame.width; sizeHints.max_height = (int)frame.height; } else { + // Avoid setting PBaseSize for top level views to avoid window manager bugs const PuglViewSize defaultSize = view->sizeHints[PUGL_DEFAULT_SIZE]; - if (puglIsValidSize(defaultSize)) { + if (puglIsValidSize(defaultSize) && view->parent) { sizeHints.flags |= PBaseSize; sizeHints.base_width = defaultSize.width; sizeHints.base_height = defaultSize.height; -- cgit v1.2.1