|
@@ -206,8 +206,10 @@ puglCreateWindow(PuglView* view, const char* title) |
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
puglUpdateGeometryConstraints(view, view->min_width, view->min_height, view->min_width != view->width); |
|
|
|
|
|
XResizeWindow(view->impl->display, view->impl->win, view->width, view->height); |
|
|
|
|
|
|
|
|
if (view->width > 1 || view->height > 1) { |
|
|
|
|
|
puglUpdateGeometryConstraints(view, view->min_width, view->min_height, view->min_width != view->width); |
|
|
|
|
|
XResizeWindow(view->impl->display, view->impl->win, view->width, view->height); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (title) { |
|
|
if (title) { |
|
|
XStoreName(impl->display, impl->win, title); |
|
|
XStoreName(impl->display, impl->win, title); |
|
@@ -419,6 +421,9 @@ send_event: |
|
|
PuglStatus |
|
|
PuglStatus |
|
|
puglProcessEvents(PuglView* view) |
|
|
puglProcessEvents(PuglView* view) |
|
|
{ |
|
|
{ |
|
|
|
|
|
int conf_width = -1; |
|
|
|
|
|
int conf_height = -1; |
|
|
|
|
|
|
|
|
XEvent event; |
|
|
XEvent event; |
|
|
while (XPending(view->impl->display) > 0) { |
|
|
while (XPending(view->impl->display) > 0) { |
|
|
XNextEvent(view->impl->display, &event); |
|
|
XNextEvent(view->impl->display, &event); |
|
@@ -464,16 +469,15 @@ puglProcessEvents(PuglView* view) |
|
|
case ConfigureNotify: |
|
|
case ConfigureNotify: |
|
|
if ((event.xconfigure.width != view->width) || |
|
|
if ((event.xconfigure.width != view->width) || |
|
|
(event.xconfigure.height != view->height)) { |
|
|
(event.xconfigure.height != view->height)) { |
|
|
puglReshape(view, |
|
|
|
|
|
event.xconfigure.width, |
|
|
|
|
|
event.xconfigure.height); |
|
|
|
|
|
|
|
|
conf_width = event.xconfigure.width; |
|
|
|
|
|
conf_height = event.xconfigure.height; |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case Expose: |
|
|
case Expose: |
|
|
if (event.xexpose.count != 0) { |
|
|
if (event.xexpose.count != 0) { |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
puglDisplay(view); |
|
|
|
|
|
|
|
|
view->redisplay = true; |
|
|
break; |
|
|
break; |
|
|
case MotionNotify: |
|
|
case MotionNotify: |
|
|
setModifiers(view, event.xmotion.state, event.xmotion.time); |
|
|
setModifiers(view, event.xmotion.state, event.xmotion.time); |
|
@@ -549,6 +553,10 @@ puglProcessEvents(PuglView* view) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (conf_width != -1) { |
|
|
|
|
|
puglReshape(view, conf_width, conf_height); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (view->pending_resize) { |
|
|
if (view->pending_resize) { |
|
|
puglResize(view); |
|
|
puglResize(view); |
|
|
} |
|
|
} |
|
|