diff options
-rw-r--r-- | sway/desktop/xwayland.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 28d7c058..845d158d 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #define _POSIX_C_SOURCE 199309L | 1 | #define _POSIX_C_SOURCE 199309L |
2 | #include <float.h> | ||
2 | #include <stdbool.h> | 3 | #include <stdbool.h> |
3 | #include <stdlib.h> | 4 | #include <stdlib.h> |
4 | #include <wayland-server-core.h> | 5 | #include <wayland-server-core.h> |
@@ -293,7 +294,18 @@ static void destroy(struct sway_view *view) { | |||
293 | free(xwayland_view); | 294 | free(xwayland_view); |
294 | } | 295 | } |
295 | 296 | ||
297 | static void get_constraints(struct sway_view *view, double *min_width, | ||
298 | double *max_width, double *min_height, double *max_height) { | ||
299 | struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface; | ||
300 | struct wlr_xwayland_surface_size_hints *size_hints = surface->size_hints; | ||
301 | *min_width = size_hints->min_width > 0 ? size_hints->min_width : DBL_MIN; | ||
302 | *max_width = size_hints->max_width > 0 ? size_hints->max_width : DBL_MAX; | ||
303 | *min_height = size_hints->min_height > 0 ? size_hints->min_height : DBL_MIN; | ||
304 | *max_height = size_hints->max_height > 0 ? size_hints->max_height : DBL_MAX; | ||
305 | } | ||
306 | |||
296 | static const struct sway_view_impl view_impl = { | 307 | static const struct sway_view_impl view_impl = { |
308 | .get_constraints = get_constraints, | ||
297 | .get_string_prop = get_string_prop, | 309 | .get_string_prop = get_string_prop, |
298 | .get_int_prop = get_int_prop, | 310 | .get_int_prop = get_int_prop, |
299 | .configure = configure, | 311 | .configure = configure, |