From e72f86784c6e2750668b3361269ded4d08d94ead Mon Sep 17 00:00:00 2001 From: minus Date: Thu, 2 Aug 2018 23:19:01 +0200 Subject: Fix crash on mouse motion on fullscreen container container_at expects a workspace, not the fullscreened container. Fixes #2409 --- sway/input/cursor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sway/input/cursor.c') diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 79f6ec46..99858d93 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -99,8 +99,7 @@ static struct sway_container *container_at_coords( return ws; } if (ws->sway_workspace->fullscreen) { - return container_at(ws->sway_workspace->fullscreen, lx, ly, - surface, sx, sy); + return container_at(ws, lx, ly, surface, sx, sy); } if ((*surface = layer_surface_at(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], -- cgit v1.2.3 From b3365645114b17b9a5d3efe6e0e81758cd8c47b5 Mon Sep 17 00:00:00 2001 From: emersion Date: Thu, 2 Aug 2018 22:48:43 +0100 Subject: Fix pointer events for fullscreen views --- include/sway/tree/container.h | 4 ++++ sway/input/cursor.c | 3 ++- sway/tree/container.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'sway/input/cursor.c') diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 12ff8a5a..c3942e9e 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -234,6 +234,10 @@ struct sway_container *container_at(struct sway_container *workspace, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy); +struct sway_container *container_at_view(struct sway_container *view, + double lx, double ly, struct wlr_surface **surface, + double *sx, double *sy); + /** * Apply the function for each descendant of the container breadth first. */ diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 99858d93..c2fc4e9e 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -99,7 +99,8 @@ static struct sway_container *container_at_coords( return ws; } if (ws->sway_workspace->fullscreen) { - return container_at(ws, lx, ly, surface, sx, sy); + return container_at_view(ws->sway_workspace->fullscreen, lx, ly, + surface, sx, sy); } if ((*surface = layer_surface_at(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], diff --git a/sway/tree/container.c b/sway/tree/container.c index b980c5e9..46c54e2d 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -535,7 +535,7 @@ struct sway_container *container_parent(struct sway_container *container, return container; } -static struct sway_container *container_at_view(struct sway_container *swayc, +struct sway_container *container_at_view(struct sway_container *swayc, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy) { if (!sway_assert(swayc->type == C_VIEW, "Expected a view")) { -- cgit v1.2.3