- _window = XCreateWindow(_display, DefaultRootWindow(_display), x, y, _width, _height,
- 0, 0, InputOutput, CopyFromParent,
- CWBackPixmap | CWEventMask | CWBackingStore,
- &xswa);
+ XSizeHints size_hints;
+ size_hints.flags = PMinSize | PMaxSize | USPosition;
+ size_hints.x = x; // These two lines do not seem to be required
+ size_hints.y = y; // ...
+ size_hints.min_width = _width;
+ size_hints.min_height = _height;
+ size_hints.max_width = _width;
+ size_hints.max_height = _height;
+ XSetNormalHints(_display, _window, &size_hints);