aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-03 22:09:20 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-03 22:09:20 +1000
commit5dd535b67a985c7751d1dc351528f0194c33458a (patch)
tree28313c7030ce4d6b01d67dbfff77c34bae76ddf5 /sway/input/seat.c
parentRemove HACKING.md (diff)
downloadsway-5dd535b67a985c7751d1dc351528f0194c33458a.tar.gz
sway-5dd535b67a985c7751d1dc351528f0194c33458a.tar.zst
sway-5dd535b67a985c7751d1dc351528f0194c33458a.zip
Add sanity check for empty focus stack
Diffstat (limited to 'sway/input/seat.c')
-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) {
952 if (!seat->has_focus) { 952 if (!seat->has_focus) {
953 return NULL; 953 return NULL;
954 } 954 }
955 if (wl_list_length(&seat->focus_stack) == 0) {
956 return NULL;
957 }
955 struct sway_seat_node *current = 958 struct sway_seat_node *current =
956 wl_container_of(seat->focus_stack.next, current, link); 959 wl_container_of(seat->focus_stack.next, current, link);
957 return current->node; 960 return current->node;