- xswa.background_pixmap = _pixmap;
- xswa.event_mask = ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | KeyPressMask | KeyReleaseMask;
- xswa.backing_store = Always;
+ 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);