DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit 3aeed6e3a31c546d52fd3244157dbca21097c4f6
parent 06843c20353b0f829ddc52a1e5c801d799d343ef
Author: falkTX <falktx@falktx.com>
Date:   Sun, 10 Mar 2024 16:44:33 +0100

Fix X11 resizes of non-user-resizable windows

Signed-off-by: falkTX <falktx@falktx.com>

Diffstat:
Mdgl/src/pugl.cpp | 13++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/dgl/src/pugl.cpp b/dgl/src/pugl.cpp @@ -407,9 +407,16 @@ PuglStatus puglSetSizeAndDefault(PuglView* view, uint width, uint height) if (const PuglStatus status = puglSetSize(view, width, height)) return status; - // handle new PUGL_DEFAULT_SIZE hint - if (const PuglStatus status = updateSizeHints(view)) - return status; + // updateSizeHints will use last known size, which is not yet updated + const PuglSpan lastWidth = view->lastConfigure.width; + const PuglSpan lastHeight = view->lastConfigure.height; + view->lastConfigure.width = static_cast<PuglSpan>(width); + view->lastConfigure.height = static_cast<PuglSpan>(height); + + updateSizeHints(view); + + view->lastConfigure.width = lastWidth; + view->lastConfigure.height = lastHeight; // flush size changes XFlush(view->world->impl->display);