diff options
author | David Robillard <d@drobilla.net> | 2020-10-20 23:08:00 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-20 23:08:26 +0200 |
commit | a8d2aa2761dcbaf491da09a375e246758b1137c4 (patch) | |
tree | 48609b19e42001ec6bfa9be9d6c6d0e5034c1a5b /pugl/detail | |
parent | 83c4baa25e24920cc6da2e1f87118bc47ed35851 (diff) | |
download | pugl-a8d2aa2761dcbaf491da09a375e246758b1137c4.tar.gz pugl-a8d2aa2761dcbaf491da09a375e246758b1137c4.tar.bz2 pugl-a8d2aa2761dcbaf491da09a375e246758b1137c4.zip |
Fix puglSetFrame() error handling on X11
Diffstat (limited to 'pugl/detail')
-rw-r--r-- | pugl/detail/x11.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c index a41de3e..6958785 100644 --- a/pugl/detail/x11.c +++ b/pugl/detail/x11.c @@ -1190,15 +1190,18 @@ puglSetWindowTitle(PuglView* view, const char* title) PuglStatus puglSetFrame(PuglView* view, const PuglRect frame) { - view->frame = frame; - - if (view->impl->win && - !XMoveResizeWindow(view->world->impl->display, view->impl->win, - (int)frame.x, (int)frame.y, - (unsigned)frame.width, (unsigned)frame.height)) { - return PUGL_UNKNOWN_ERROR; + if (view->impl->win) { + if (!XMoveResizeWindow(view->world->impl->display, + view->impl->win, + (int)frame.x, + (int)frame.y, + (unsigned)frame.width, + (unsigned)frame.height)) { + return PUGL_UNKNOWN_ERROR; + } } + view->frame = frame; return PUGL_SUCCESS; } |