mirror of
https://github.com/swaywm/sway.git
synced 2025-11-17 06:59:48 -05:00
Implement urgency base functionality
Introduces a command to manually set urgency, as well as rendering of urgent views, sending the IPC event, removing urgency after focused for one second, and matching urgent views via criteria.
This commit is contained in:
parent
b314a8f2cc
commit
315d5311b2
12 changed files with 170 additions and 7 deletions
|
|
@ -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) {
|
||||
|
|
@ -670,6 +676,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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue