diff options
Diffstat (limited to 'pugl/detail/x11.c')
-rw-r--r-- | pugl/detail/x11.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c index d3e4195..bcc0b49 100644 --- a/pugl/detail/x11.c +++ b/pugl/detail/x11.c @@ -257,6 +257,12 @@ puglCreateWindow(PuglView* view, const char* title) const PuglEvent createEvent = {{PUGL_CREATE, 0}}; puglDispatchEvent(view, &createEvent); + view->impl->pendingConfigure.configure.type = PUGL_CONFIGURE; + view->impl->pendingConfigure.configure.x = view->frame.x; + view->impl->pendingConfigure.configure.y = view->frame.y; + view->impl->pendingConfigure.configure.width = view->frame.width; + view->impl->pendingConfigure.configure.height = view->frame.height; + return PUGL_SUCCESS; } @@ -617,19 +623,21 @@ flushPendingConfigure(PuglView* view) { PuglEvent* const configure = &view->impl->pendingConfigure; - if (configure->type) { - view->frame.x = configure->configure.x; - view->frame.y = configure->configure.y; - - if (configure->configure.width != view->frame.width || - configure->configure.height != view->frame.height) { - view->frame.width = configure->configure.width; - view->frame.height = configure->configure.height; - - view->backend->resize(view, - (int)view->frame.width, - (int)view->frame.height); - } + if (!view->configured || + (configure->type && + (configure->configure.x != view->frame.x || + configure->configure.y != view->frame.y || + configure->configure.width != view->frame.width || + configure->configure.height != view->frame.height))) { + + view->frame.x = configure->configure.x; + view->frame.y = configure->configure.y; + view->frame.width = configure->configure.width; + view->frame.height = configure->configure.height; + + view->backend->resize(view, + (int)view->frame.width, + (int)view->frame.height); view->eventFunc(view, configure); configure->type = 0; |