aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-07-13 11:47:38 -0400
committerDavid Robillard <d@drobilla.net>2024-07-13 11:47:38 -0400
commit143861758f472340d887978f1afb1b1d3a5130bc (patch)
treeec73a82b03986178a2497111a560fe28e914ea09 /src/x11.c
parent996196c0db350140f7097e9b463919effd954077 (diff)
downloadpugl-143861758f472340d887978f1afb1b1d3a5130bc.tar.gz
pugl-143861758f472340d887978f1afb1b1d3a5130bc.tar.bz2
pugl-143861758f472340d887978f1afb1b1d3a5130bc.zip
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.
Diffstat (limited to 'src/x11.c')
-rw-r--r--src/x11.c3
1 files changed, 2 insertions, 1 deletions
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;