aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-07-21 10:27:40 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-07-21 10:28:07 +1000
commit37b33f92e8cd94984c4e3c8c851f5dfdacbe14f5 (patch)
tree1d043b7551e251f1b662e952e9f62be72877a7cc /sway
parentc2ed3d8bd6e2ec12f2ce70d7e106c09a7078e91f (diff)
Fix urgent timer logic and remove unnecessary header includes
Diffstat (limited to 'sway')
-rw-r--r--sway/commands/force_display_urgency_hint.c5
-rw-r--r--sway/input/seat.c16
2 files changed, 10 insertions, 11 deletions
diff --git a/sway/commands/force_display_urgency_hint.c b/sway/commands/force_display_urgency_hint.c
index a25ffff8..5e5e2d55 100644
--- a/sway/commands/force_display_urgency_hint.c
+++ b/sway/commands/force_display_urgency_hint.c
@@ -1,10 +1,5 @@
-#include "log.h"
#include "sway/commands.h"
#include "sway/config.h"
-#include "sway/tree/arrange.h"
-#include "sway/tree/container.h"
-#include "sway/tree/view.h"
-#include "sway/tree/layout.h"
struct cmd_results *cmd_force_display_urgency_hint(int argc, char **argv) {
struct cmd_results *error = NULL;
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,
}
}
- // If urgent, start a timer to unset it
+ // If urgent, either unset the urgency or start a timer to unset it
if (container && container->type == C_VIEW &&
- last_workspace && last_workspace != new_workspace &&
view_is_urgent(container->sway_view) &&
- config->urgent_timeout > 0 &&
!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, config->urgent_timeout);
+ if (last_workspace && last_workspace != new_workspace &&
+ config->urgent_timeout > 0) {
+ view->urgent_timer = wl_event_loop_add_timer(server.wl_event_loop,
+ handle_urgent_timeout, view);
+ wl_event_source_timer_update(view->urgent_timer,
+ config->urgent_timeout);
+ } else {
+ view_set_urgent(view, false);
+ }
}
// If we've focused a floating container, bring it to the front.