diff options
author | Leo <leo881003@gmail.com> | 2020-03-23 16:23:01 +0800 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-03-23 17:30:02 +0100 |
commit | 0b9feb6f39b34d154d4841d21dd3cdc88e861feb (patch) | |
tree | 3faec683d30cd341fde54fb44147460c1de79736 | |
parent | Fix output mode usage (diff) | |
download | sway-0b9feb6f39b34d154d4841d21dd3cdc88e861feb.tar.gz sway-0b9feb6f39b34d154d4841d21dd3cdc88e861feb.tar.zst sway-0b9feb6f39b34d154d4841d21dd3cdc88e861feb.zip |
Fix redundant call to seat_send_focus()
This commit fix calling to seat_send_focus() twice when a view is
closed. This codes revert #2580, but the original issue nolonger
exists.
-rw-r--r-- | sway/input/seat.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 920742e9..502bc0bc 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -288,8 +288,11 @@ static void handle_seat_node_destroy(struct wl_listener *listener, void *data) { | |||
288 | } | 288 | } |
289 | // The structure change might have caused it to move up to the top of | 289 | // The structure change might have caused it to move up to the top of |
290 | // the focus stack without sending focus notifications to the view | 290 | // the focus stack without sending focus notifications to the view |
291 | seat_send_focus(next_focus, seat); | 291 | if (seat_get_focus(seat) == next_focus) { |
292 | seat_set_focus(seat, next_focus); | 292 | seat_send_focus(next_focus, seat); |
293 | } else { | ||
294 | seat_set_focus(seat, next_focus); | ||
295 | } | ||
293 | } else { | 296 | } else { |
294 | // Setting focus_inactive | 297 | // Setting focus_inactive |
295 | focus = seat_get_focus_inactive(seat, &root->node); | 298 | focus = seat_get_focus_inactive(seat, &root->node); |