aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Rouven Czerwinski <rouven@czerwinskis.de>2020-01-03 07:36:33 +0100
committerLibravatar Drew DeVault <sir@cmpwn.com>2020-01-08 10:27:20 -0500
commit2aecf93fd7fdb3c4c06063942599b6b7d28dd635 (patch)
tree9476d4428a7503068b55bdfb8053765faa91832c
parentinput: Assign virtual input devices to their selected seats (diff)
downloadsway-2aecf93fd7fdb3c4c06063942599b6b7d28dd635.tar.gz
sway-2aecf93fd7fdb3c4c06063942599b6b7d28dd635.tar.zst
sway-2aecf93fd7fdb3c4c06063942599b6b7d28dd635.zip
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 845d158d..e99fe06a 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,
298 double *max_width, double *min_height, double *max_height) { 298 double *max_width, double *min_height, double *max_height) {
299 struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface; 299 struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface;
300 struct wlr_xwayland_surface_size_hints *size_hints = surface->size_hints; 300 struct wlr_xwayland_surface_size_hints *size_hints = surface->size_hints;
301
302 if (size_hints == NULL) {
303 *min_width = DBL_MIN;
304 *max_width = DBL_MAX;
305 *min_height = DBL_MIN;
306 *max_height = DBL_MAX;
307 return;
308 }
309
301 *min_width = size_hints->min_width > 0 ? size_hints->min_width : DBL_MIN; 310 *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; 311 *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; 312 *min_height = size_hints->min_height > 0 ? size_hints->min_height : DBL_MIN;