aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-08-03 18:08:20 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-08-03 18:08:20 +1000
commitc17f0870ef1620e73b18f0b0ce8303c94027d19b (patch)
treeeb00ad1385d5632494b15e19a9c3afe9b16a8789
parent5ac3509d546ee2e585ecb58aeea94ff9f3e8259d (diff)
downloadsway-c17f0870ef1620e73b18f0b0ce8303c94027d19b.zip
sway-c17f0870ef1620e73b18f0b0ce8303c94027d19b.tar.gz
sway-c17f0870ef1620e73b18f0b0ce8303c94027d19b.tar.bz2
Fix crash when moving cursor over a fullscreen split container
Calling container_at_view fails an assertion if the container isn't a view. Calling tiling_container_at works correctly, as that function checks if the container is a view and calls container_at_view if so.
-rw-r--r--include/sway/tree/container.h6
-rw-r--r--sway/input/cursor.c2
-rw-r--r--sway/tree/container.c8
3 files changed, 6 insertions, 10 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index c3942e9..44ff9f7 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -234,9 +234,9 @@ 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);
+struct sway_container *tiling_container_at(
+ struct sway_container *con, 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 c2fc4e9..80b4f9d 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -99,7 +99,7 @@ static struct sway_container *container_at_coords(
return ws;
}
if (ws->sway_workspace->fullscreen) {
- return container_at_view(ws->sway_workspace->fullscreen, lx, ly,
+ return tiling_container_at(ws->sway_workspace->fullscreen, lx, ly,
surface, sx, sy);
}
if ((*surface = layer_surface_at(output,
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 46c54e2..4a50365 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;
}
-struct sway_container *container_at_view(struct sway_container *swayc,
+static 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")) {
@@ -574,10 +574,6 @@ struct sway_container *container_at_view(struct sway_container *swayc,
return NULL;
}
-static struct sway_container *tiling_container_at(
- struct sway_container *con, double lx, double ly,
- struct wlr_surface **surface, double *sx, double *sy);
-
/**
* container_at for a container with layout L_TABBED.
*/
@@ -684,7 +680,7 @@ static struct sway_container *floating_container_at(double lx, double ly,
return NULL;
}
-static struct sway_container *tiling_container_at(
+struct sway_container *tiling_container_at(
struct sway_container *con, double lx, double ly,
struct wlr_surface **surface, double *sx, double *sy) {
if (con->type == C_VIEW) {