From a8d2aa2761dcbaf491da09a375e246758b1137c4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 20 Oct 2020 23:08:00 +0200 Subject: Fix puglSetFrame() error handling on X11 --- pugl/detail/x11.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'pugl/detail') 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; } -- cgit v1.2.1