diff options
Diffstat (limited to 'pugl')
-rw-r--r-- | pugl/detail/x11.c | 17 | ||||
-rw-r--r-- | pugl/pugl.h | 3 |
2 files changed, 13 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; } diff --git a/pugl/pugl.h b/pugl/pugl.h index cd931ed..a665721 100644 --- a/pugl/pugl.h +++ b/pugl/pugl.h @@ -969,6 +969,9 @@ puglGetFrame(const PuglView* view); Set the current position and size of the view. The position is in screen coordinates with an upper left origin. + + @return #PUGL_UNKNOWN_ERROR on failure, in which case the view frame is + unchanged. */ PUGL_API PuglStatus puglSetFrame(PuglView* view, PuglRect frame); |