sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 0c23525d4798d0d84f6c9acc06cbb022446e4934
parent d2cab83833691fdde1fbb5b2e4fb0a9786e39e47
Author: Brian Ashworth <bosrsf04@gmail.com>
Date:   Mon, 17 Feb 2020 17:12:04 -0500

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.

Diffstat:
Msway/tree/view.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sway/tree/view.c b/sway/tree/view.c @@ -896,8 +896,10 @@ void view_child_init(struct sway_view_child *child, wl_signal_add(&view->events.unmap, &child->view_unmap); child->view_unmap.notify = view_child_handle_view_unmap; - struct sway_output *output = child->view->container->workspace->output; - wlr_surface_send_enter(child->surface, output->wlr_output); + struct sway_workspace *workspace = child->view->container->workspace; + if (workspace) { + wlr_surface_send_enter(child->surface, workspace->output->wlr_output); + } view_init_subsurfaces(child->view, surface); }