diff options
author | 2020-02-17 17:12:04 -0500 | |
---|---|---|
committer | 2020-02-18 10:27:37 +0100 | |
commit | 0c23525d4798d0d84f6c9acc06cbb022446e4934 (patch) | |
tree | e26db6421f82a8b9100215030dc17135645bdd3b | |
parent | i3compat: add `window_type` to IPC response (diff) | |
download | sway-0c23525d4798d0d84f6c9acc06cbb022446e4934.tar.gz sway-0c23525d4798d0d84f6c9acc06cbb022446e4934.tar.zst sway-0c23525d4798d0d84f6c9acc06cbb022446e4934.zip |
tree/view: do not attempt enter on hidden child
If a subsurface is created for a surface that is associated with a
scratchpad hidden view, do not attempt to send an enter to it. The
subsurface is not on any output and since there is no workspace
associated with the view, attempting to get the output for the NULL
workspace will result in a SIGSEGV.
-rw-r--r-- | sway/tree/view.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index fc88cff9..04ff4b57 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -896,8 +896,10 @@ void view_child_init(struct sway_view_child *child, | |||
896 | wl_signal_add(&view->events.unmap, &child->view_unmap); | 896 | wl_signal_add(&view->events.unmap, &child->view_unmap); |
897 | child->view_unmap.notify = view_child_handle_view_unmap; | 897 | child->view_unmap.notify = view_child_handle_view_unmap; |
898 | 898 | ||
899 | struct sway_output *output = child->view->container->workspace->output; | 899 | struct sway_workspace *workspace = child->view->container->workspace; |
900 | wlr_surface_send_enter(child->surface, output->wlr_output); | 900 | if (workspace) { |
901 | wlr_surface_send_enter(child->surface, workspace->output->wlr_output); | ||
902 | } | ||
901 | 903 | ||
902 | view_init_subsurfaces(child->view, surface); | 904 | view_init_subsurfaces(child->view, surface); |
903 | } | 905 | } |