diff options
author | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2021-04-14 11:04:21 +0200 |
---|---|---|
committer | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2021-04-14 11:04:21 +0200 |
commit | d46b7d1a180d24ee5573e3aa3fddc7fa54a495b8 (patch) | |
tree | 782d7c77768ae36e60f758591f82e05a27ff7cbb /subprojects/d2tk/pugl/src/x11.c | |
parent | 73e3c79b4246e1d8fd371485237387b5ebdcdd2f (diff) | |
parent | 969ce6ed699729f54af943e880873de6f78a3e85 (diff) | |
download | synthpod-d46b7d1a180d24ee5573e3aa3fddc7fa54a495b8.tar.xz |
Merge commit '969ce6ed699729f54af943e880873de6f78a3e85'
Diffstat (limited to 'subprojects/d2tk/pugl/src/x11.c')
-rw-r--r-- | subprojects/d2tk/pugl/src/x11.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/subprojects/d2tk/pugl/src/x11.c b/subprojects/d2tk/pugl/src/x11.c index 24054f9c..2cdb0f3c 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); } |