From 729e9f264c1ee4842836aadf0d12899e11132af7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 24 Dec 2022 22:18:51 -0500 Subject: Fix weird/inconsistent control flow in puglSetSize() I'm not really sure about directly updating the frame like this - or whether these fields should even exist in the first place (it's questionable whether the view is "really" the new size until the configure process is complete) - but regardless, the same pattern should probably be used for both size and position. "Probably", because touching anything like this tends to break some situation or another somewhere, but such is life. --- src/x11.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/x11.c b/src/x11.c index ac4950d..fc0e2af 100644 --- a/src/x11.c +++ b/src/x11.c @@ -1631,9 +1631,8 @@ puglSetSize(PuglView* const view, const unsigned width, const unsigned height) return PUGL_BAD_PARAMETER; } - if (win) { - return XResizeWindow(display, win, width, height) ? PUGL_SUCCESS - : PUGL_UNKNOWN_ERROR; + if (win && !XResizeWindow(display, win, width, height)) { + return PUGL_UNKNOWN_ERROR; } view->frame.width = (PuglSpan)width; -- cgit v1.2.1