aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-07-16 15:39:08 -0700
committerGitHub <noreply@github.com>2018-07-16 15:39:08 -0700
commitd6bd314dffb7385eec73de40f0fdd5775cd5941b (patch)
tree1cec389e971cda3e42766c07789d0f51c2d39715 /sway/input
parent297e32126f1f8b27f51989b863e4ea1c9fce6a96 (diff)
parent255dc8bbb040c4f268f318bde86701227d82da3f (diff)
Merge pull request #2276 from RyanDwyer/urgency
Implement urgency base functionality
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/seat.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 85321dbe..12b1fab5 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -594,6 +594,12 @@ static void seat_send_unfocus(struct sway_container *container,
}
}
+static int handle_urgent_timeout(void *data) {
+ struct sway_view *view = data;
+ view_set_urgent(view, false);
+ return 0;
+}
+
void seat_set_focus_warp(struct sway_seat *seat,
struct sway_container *container, bool warp) {
if (seat->focused_layer) {
@@ -671,6 +677,16 @@ void seat_set_focus_warp(struct sway_seat *seat,
}
}
+ // If urgent, start a timer to unset it
+ if (container && container->type == C_VIEW &&
+ view_is_urgent(container->sway_view) &&
+ !container->sway_view->urgent_timer) {
+ struct sway_view *view = container->sway_view;
+ view->urgent_timer = wl_event_loop_add_timer(server.wl_event_loop,
+ handle_urgent_timeout, view);
+ wl_event_source_timer_update(view->urgent_timer, 1000);
+ }
+
// If we've focused a floating container, bring it to the front.
// We do this by putting it at the end of the floating list.
// This must happen for both the pending and current children lists.