summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRouven Czerwinski <rouven@czerwinskis.de>2020-01-03 07:36:33 +0100
committerDrew DeVault <sir@cmpwn.com>2020-01-08 10:27:20 -0500
commit2aecf93fd7fdb3c4c06063942599b6b7d28dd635 (patch)
tree9476d4428a7503068b55bdfb8053765faa91832c
parentc35663772ab8b0a80cd7dc1b8d6f4cdbd369df6f (diff)
xwayland: handle size_hints == NULL
In case xcb-iccm is not installed on the system, size_hints will be null. Handle this as if the get_constraints functions was not implemented and return the defaults. Fixes #4870
-rw-r--r--sway/desktop/xwayland.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 845d158d3..e99fe06aa 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -298,6 +298,15 @@ static void get_constraints(struct sway_view *view, double *min_width,
double *max_width, double *min_height, double *max_height) {
struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface;
struct wlr_xwayland_surface_size_hints *size_hints = surface->size_hints;
+
+ if (size_hints == NULL) {
+ *min_width = DBL_MIN;
+ *max_width = DBL_MAX;
+ *min_height = DBL_MIN;
+ *max_height = DBL_MAX;
+ return;
+ }
+
*min_width = size_hints->min_width > 0 ? size_hints->min_width : DBL_MIN;
*max_width = size_hints->max_width > 0 ? size_hints->max_width : DBL_MAX;
*min_height = size_hints->min_height > 0 ? size_hints->min_height : DBL_MIN;