summaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorRyan Dwyer <[email protected]>2018-09-11 23:38:17 +1000
committerRyan Dwyer <[email protected]>2018-09-11 23:38:17 +1000
commitdf95c61044c37b511922db03eb5bd868b374e9d4 (patch)
tree21de258f7e4e3c9deb4f7d49bbd2208ffd248f77 /sway/tree/container.c
parent403905c11bf9996cf1937ec0067f33d013e78305 (diff)
Fix crash in workspace_wrap_children
When workspace_wrap_children is called on a workspace which has a fullscreen child and the fullscreen child is a direct child of the workspace, sway would crash. The workspace's fullscreen pointer is unset when the fullscreen container is detached and applied again when added to a parent, but in this case the parent hadn't yet been added to the workspace which meant con->workspace was NULL. The fix makes container_handle_fullscreen_reparent return if there's no workspace, and the fullscreen pointer is reapplied in workspace_wrap_children.
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index ff10c1ab..21a0cd76 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -1063,7 +1063,8 @@ list_t *container_get_current_siblings(struct sway_container *container) {
}
void container_handle_fullscreen_reparent(struct sway_container *con) {
- if (!con->is_fullscreen || con->workspace->fullscreen == con) {
+ if (!con->is_fullscreen || !con->workspace ||
+ con->workspace->fullscreen == con) {
return;
}
if (con->workspace->fullscreen) {