aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-10-03 14:17:28 +0200
committerGitHub <noreply@github.com>2018-10-03 14:17:28 +0200
commit01b8e171b8dd2dbdda1b1a652c39022602cd9dfb (patch)
tree28313c7030ce4d6b01d67dbfff77c34bae76ddf5 /sway/input
parent54a835e962b45683e1def4a9aaf1c1371fb4aa28 (diff)
parent5dd535b67a985c7751d1dc351528f0194c33458a (diff)
Merge pull request #2757 from RyanDwyer/check-focus-stack-empty
Add sanity check for empty focus stack
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/seat.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index e10b6409..69bee47e 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -952,6 +952,9 @@ struct sway_node *seat_get_focus(struct sway_seat *seat) {
if (!seat->has_focus) {
return NULL;
}
+ if (wl_list_length(&seat->focus_stack) == 0) {
+ return NULL;
+ }
struct sway_seat_node *current =
wl_container_of(seat->focus_stack.next, current, link);
return current->node;