summaryrefslogtreecommitdiff
path: root/plugingui/nativewindow_x11.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-10-19 11:20:12 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-10-19 11:20:12 +0200
commitc4f69d2af7d995eb0dd4592c18dc2f6b930bd193 (patch)
tree05118efa264bb2623719cfa1d579ca1ed1cf1980 /plugingui/nativewindow_x11.cc
parentae63d465c7252602500c4de5aa2d2a99df852bfb (diff)
Make window fixed size.
Diffstat (limited to 'plugingui/nativewindow_x11.cc')
-rw-r--r--plugingui/nativewindow_x11.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/plugingui/nativewindow_x11.cc b/plugingui/nativewindow_x11.cc
index f8511a0..cb6cf73 100644
--- a/plugingui/nativewindow_x11.cc
+++ b/plugingui/nativewindow_x11.cc
@@ -82,6 +82,31 @@ GUI::NativeWindowX11::~NativeWindowX11()
XCloseDisplay(display);
}
+void GUI::NativeWindowX11::setFixedSize(int width, int height)
+{
+ resize(width, height);
+
+ XSizeHints *size_hints;
+ size_hints = XAllocSizeHints();
+
+ if(size_hints == NULL) {
+ //fprintf(stderr,"XMallocSizeHints() failed\n");
+ //exit(1);
+ return;
+ }
+
+ size_hints->flags = USPosition | PMinSize | PMaxSize;
+ size_hints->min_width = size_hints->max_width = width;
+ size_hints->min_height = size_hints->max_height = height;
+ /*
+ size_hints->min_aspect.x = window->width()/window->height();
+ size_hints->max_aspect.x = window->width()/window->height();
+ size_hints->min_aspect.y = window->width()/window->height();
+ size_hints->max_aspect.y = size_hints->min_aspect.y;
+ */
+ XSetWMNormalHints(display, xwindow, size_hints);
+}
+
void GUI::NativeWindowX11::resize(int width, int height)
{
XResizeWindow(display, xwindow, width, height);