aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-03-27 14:00:19 -0400
committerLibravatar emersion <contact@emersion.fr>2019-03-31 09:32:23 +0300
commitdd28e6a6d6abf06d2d16e6c91aeaf942bf225af7 (patch)
tree98d0836c238f9e49b25e65de7c6645813dfe1ad6 /sway/desktop/xwayland.c
parentFix a crash in swaybar when an icon dir is not readable (diff)
downloadsway-dd28e6a6d6abf06d2d16e6c91aeaf942bf225af7.tar.gz
sway-dd28e6a6d6abf06d2d16e6c91aeaf942bf225af7.tar.zst
sway-dd28e6a6d6abf06d2d16e6c91aeaf942bf225af7.zip
Fix xwayland configure request scratchpad crash
This fixes a crash in `container_init_floating` when a xwayland view sends a configure request while in the scratchpad. `container_init_floating` gets called so the configured minimum and maximum sizes gets respected when resizing to the requested size. Since the workspace was NULL, it would SIGSEGV when attempting to get the workspace's output for the output box retrieval. This extracts the resizing portion of `container_init_floating` into a separate function. If the container is in the scratchpad, it will just be resized and skip the centering. Additionally, `container_init_floating` has been renamed to `container_floating_resize_and_center` to more accurately describe what it does.
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index f5ade8dc..37d0b986 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -435,7 +435,7 @@ static void handle_request_configure(struct wl_listener *listener, void *data) {
435 // Respect minimum and maximum sizes 435 // Respect minimum and maximum sizes
436 view->natural_width = ev->width; 436 view->natural_width = ev->width;
437 view->natural_height = ev->height; 437 view->natural_height = ev->height;
438 container_init_floating(view->container); 438 container_floating_resize_and_center(view->container);
439 439
440 configure(view, view->container->content_x, 440 configure(view, view->container->content_x,
441 view->container->content_y, 441 view->container->content_y,