aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2019-03-27 14:00:19 -0400
committerFurkan Sahin <furkan-dev@proton.me>2019-03-27 14:00:19 -0400
commit0c3b9a55387a06a5c3af9045c0d1bb8287f0b164 (patch)
tree98d0836c238f9e49b25e65de7c6645813dfe1ad6 /include
parent85299073a6fa2d08a9b6c7df0e9a679a2d1f827b (diff)
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 'include')
-rw-r--r--include/sway/tree/container.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index d2508994..964061db 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -215,10 +215,7 @@ size_t container_titlebar_height(void);
void floating_calculate_constraints(int *min_width, int *max_width,
int *min_height, int *max_height);
-/**
- * Resize and center the container in its workspace.
- */
-void container_init_floating(struct sway_container *container);
+void container_floating_resize_and_center(struct sway_container *con);
void container_set_floating(struct sway_container *container, bool enable);