aboutsummaryrefslogtreecommitdiff
path: root/subprojects/d2tk/pugl/src/x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/d2tk/pugl/src/x11.c')
-rw-r--r--subprojects/d2tk/pugl/src/x11.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/subprojects/d2tk/pugl/src/x11.c b/subprojects/d2tk/pugl/src/x11.c
index 24054f9..2cdb0f3 100644
--- a/subprojects/d2tk/pugl/src/x11.c
+++ b/subprojects/d2tk/pugl/src/x11.c
@@ -217,20 +217,23 @@ updateSizeHints(const PuglView* view)
sizeHints.max_height = (int)view->frame.height;
} else {
if (view->defaultWidth || view->defaultHeight) {
- sizeHints.flags = PBaseSize;
+ sizeHints.flags |= PBaseSize;
sizeHints.base_width = view->defaultWidth;
sizeHints.base_height = view->defaultHeight;
}
+
if (view->minWidth || view->minHeight) {
- sizeHints.flags = PMinSize;
+ sizeHints.flags |= PMinSize;
sizeHints.min_width = view->minWidth;
sizeHints.min_height = view->minHeight;
}
+
if (view->maxWidth || view->maxHeight) {
- sizeHints.flags = PMaxSize;
+ sizeHints.flags |= PMaxSize;
sizeHints.max_width = view->maxWidth;
sizeHints.max_height = view->maxHeight;
}
+
if (view->minAspectX) {
sizeHints.flags |= PAspect;
sizeHints.min_aspect.x = view->minAspectX;
@@ -1145,8 +1148,12 @@ puglDispatchX11Events(PuglWorld* world)
XWindowAttributes attrs;
XGetWindowAttributes(view->impl->display, view->impl->win, &attrs);
- const PuglEventConfigure configure = {
- PUGL_CONFIGURE, 0, attrs.x, attrs.y, attrs.width, attrs.height};
+ const PuglEventConfigure configure = {PUGL_CONFIGURE,
+ 0,
+ (double)attrs.x,
+ (double)attrs.y,
+ (double)attrs.width,
+ (double)attrs.height};
puglDispatchEvent(view, (const PuglEvent*)&configure);
puglDispatchEvent(view, &event);
@@ -1297,8 +1304,8 @@ puglSetMinSize(PuglView* const view, const int width, const int height)
PuglStatus
puglSetMaxSize(PuglView* const view, const int width, const int height)
{
- view->minWidth = width;
- view->minHeight = height;
+ view->maxWidth = width;
+ view->maxHeight = height;
return updateSizeHints(view);
}