diff options
Diffstat (limited to 'pugl/detail/x11.c')
-rw-r--r-- | pugl/detail/x11.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c index 1e1f96f..d7b7677 100644 --- a/pugl/detail/x11.c +++ b/pugl/detail/x11.c @@ -723,3 +723,41 @@ puglSetFrame(PuglView* view, const PuglRect frame) return PUGL_SUCCESS; } + +PuglStatus +puglSetMinSize(PuglView* const view, const int width, const int height) +{ + Display* display = view->world->impl->display; + + view->minWidth = width; + view->minHeight = height; + + if (view->impl->win) { + XSizeHints sizeHints = getSizeHints(view); + XSetNormalHints(display, view->impl->win, &sizeHints); + } + + return PUGL_SUCCESS; +} + +PuglStatus +puglSetAspectRatio(PuglView* const view, + const int minX, + const int minY, + const int maxX, + const int maxY) +{ + Display* display = view->world->impl->display; + + view->minAspectX = minX; + view->minAspectY = minY; + view->maxAspectX = maxX; + view->maxAspectY = maxY; + + if (view->impl->win) { + XSizeHints sizeHints = getSizeHints(view); + XSetNormalHints(display, view->impl->win, &sizeHints); + } + + return PUGL_SUCCESS; +} |