aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-21 10:27:40 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-21 10:28:07 +1000
commit37b33f92e8cd94984c4e3c8c851f5dfdacbe14f5 (patch)
tree1d043b7551e251f1b662e952e9f62be72877a7cc /sway/input/seat.c
parentImplement force_display_urgency_hint (diff)
downloadsway-37b33f92e8cd94984c4e3c8c851f5dfdacbe14f5.tar.gz
sway-37b33f92e8cd94984c4e3c8c851f5dfdacbe14f5.tar.zst
sway-37b33f92e8cd94984c4e3c8c851f5dfdacbe14f5.zip
Fix urgent timer logic and remove unnecessary header includes
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 816429d3..e77d88a8 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -677,16 +677,20 @@ void seat_set_focus_warp(struct sway_seat *seat,
677 } 677 }
678 } 678 }
679 679
680 // If urgent, start a timer to unset it 680 // If urgent, either unset the urgency or start a timer to unset it
681 if (container && container->type == C_VIEW && 681 if (container && container->type == C_VIEW &&
682 last_workspace && last_workspace != new_workspace &&
683 view_is_urgent(container->sway_view) && 682 view_is_urgent(container->sway_view) &&
684 config->urgent_timeout > 0 &&
685 !container->sway_view->urgent_timer) { 683 !container->sway_view->urgent_timer) {
686 struct sway_view *view = container->sway_view; 684 struct sway_view *view = container->sway_view;
687 view->urgent_timer = wl_event_loop_add_timer(server.wl_event_loop, 685 if (last_workspace && last_workspace != new_workspace &&
688 handle_urgent_timeout, view); 686 config->urgent_timeout > 0) {
689 wl_event_source_timer_update(view->urgent_timer, config->urgent_timeout); 687 view->urgent_timer = wl_event_loop_add_timer(server.wl_event_loop,
688 handle_urgent_timeout, view);
689 wl_event_source_timer_update(view->urgent_timer,
690 config->urgent_timeout);
691 } else {
692 view_set_urgent(view, false);
693 }
690 } 694 }
691 695
692 // If we've focused a floating container, bring it to the front. 696 // If we've focused a floating container, bring it to the front.