aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-12-24 22:18:51 -0500
committerDavid Robillard <d@drobilla.net>2022-12-24 22:22:41 -0500
commit729e9f264c1ee4842836aadf0d12899e11132af7 (patch)
treeeb3cf9622eaa963eb013b2d478999f4e3fd9223a
parentc8bf253019ce874cd108db49581afb8ef43b2109 (diff)
downloadpugl-729e9f264c1ee4842836aadf0d12899e11132af7.tar.gz
pugl-729e9f264c1ee4842836aadf0d12899e11132af7.tar.bz2
pugl-729e9f264c1ee4842836aadf0d12899e11132af7.zip
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.
-rw-r--r--src/x11.c5
1 files 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;