aboutsummaryrefslogtreecommitdiff
path: root/rootston/xwayland.c
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-10-29 10:43:10 -0400
committerTony Crisci <tony@dubstepdish.com>2017-10-29 10:43:10 -0400
commitc01248cf17b0556145d973449d0b12cad0b96a8c (patch)
tree8b76fcdbf82ee92ef19504d4a9c0e3abc43f8e1c /rootston/xwayland.c
parentce72a687ce3b88b69b0d319800d2f466205a15f7 (diff)
parent50e86a0efa43fa72bd7d8c2dfc2d124052f74823 (diff)
Merge branch 'master' into feature/xwm-rewrite
Diffstat (limited to 'rootston/xwayland.c')
-rw-r--r--rootston/xwayland.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/rootston/xwayland.c b/rootston/xwayland.c
index 3d066093..2d7fe946 100644
--- a/rootston/xwayland.c
+++ b/rootston/xwayland.c
@@ -18,6 +18,24 @@ static void activate(struct roots_view *view, bool active) {
static void resize(struct roots_view *view, uint32_t width, uint32_t height) {
assert(view->type == ROOTS_XWAYLAND_VIEW);
struct wlr_xwayland_surface *xwayland_surface = view->xwayland_surface;
+
+ struct wlr_xwayland_surface_size_hints *size_hints =
+ xwayland_surface->size_hints;
+ if (size_hints != NULL) {
+ if (width < (uint32_t)size_hints->min_width) {
+ width = size_hints->min_width;
+ } else if (size_hints->max_width > 0 &&
+ width > (uint32_t)size_hints->max_width) {
+ width = size_hints->max_width;
+ }
+ if (height < (uint32_t)size_hints->min_height) {
+ height = size_hints->min_height;
+ } else if (size_hints->max_height > 0 &&
+ height > (uint32_t)size_hints->max_height) {
+ height = size_hints->max_height;
+ }
+ }
+
wlr_xwayland_surface_configure(view->desktop->xwayland, xwayland_surface,
xwayland_surface->x, xwayland_surface->y, width, height);
}