aboutsummaryrefslogtreecommitdiff
path: root/aux.c
diff options
context:
space:
mode:
Diffstat (limited to 'aux.c')
-rw-r--r--aux.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/aux.c b/aux.c
index 5012968..736e903 100644
--- a/aux.c
+++ b/aux.c
@@ -16,6 +16,7 @@
*/
#include <X11/Xlib.h>
+#include <X11/Xutil.h>
#include <string.h>
@@ -76,3 +77,20 @@ move(Display *d, Window win, Window container)
XMoveWindow(d, container, dx, dy);
}
+
+void
+restrictsize(Display *d, Window win, int minw, int minh, int maxw, int maxh)
+{
+ Atom nhints;
+ XSizeHints *hints;
+
+ nhints = XInternAtom(d, "WM_NORMAL_HINTS", 0);
+ hints = XAllocSizeHints();
+ hints->flags = PMinSize|PMaxSize;
+ hints->min_width = minw;
+ hints->min_height = minh;
+ hints->max_width = maxw;
+ hints->max_height = maxh;
+ XSetWMSizeHints(d, win, hints, nhints);
+ XFree(hints);
+}