diff options
-rw-r--r-- | sway/tree/container.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 0ebdc51d..9358dad7 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -251,10 +251,12 @@ static struct sway_container *container_at_stacked(struct sway_node *parent, | |||
251 | 251 | ||
252 | // Title bars | 252 | // Title bars |
253 | int title_height = container_titlebar_height(); | 253 | int title_height = container_titlebar_height(); |
254 | int child_index = (ly - box.y) / title_height; | 254 | if (title_height > 0) { |
255 | if (child_index < children->length) { | 255 | int child_index = (ly - box.y) / title_height; |
256 | struct sway_container *child = children->items[child_index]; | 256 | if (child_index < children->length) { |
257 | return child; | 257 | struct sway_container *child = children->items[child_index]; |
258 | return child; | ||
259 | } | ||
258 | } | 260 | } |
259 | 261 | ||
260 | // Surfaces | 262 | // Surfaces |