diff options
author | David Robillard <d@drobilla.net> | 2024-07-13 11:47:38 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-07-13 11:47:38 -0400 |
commit | 143861758f472340d887978f1afb1b1d3a5130bc (patch) | |
tree | ec73a82b03986178a2497111a560fe28e914ea09 /src/x11.c | |
parent | 996196c0db350140f7097e9b463919effd954077 (diff) | |
download | pugl-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |