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:
Ryan Dwyer 2018-07-15 22:43:33 +10:00
parent b314a8f2cc
commit 315d5311b2
12 changed files with 170 additions and 7 deletions

View file

@ -553,7 +553,11 @@ static void render_container_simple(struct sway_output *output,
struct wlr_texture *marks_texture;
struct sway_container_state *state = &child->current;
if (state->focused || parent_focused) {
if (view_is_urgent(view)) {
colors = &config->border_colors.urgent;
title_texture = child->title_urgent;
marks_texture = view->marks_urgent;
} else if (state->focused || parent_focused) {
colors = &config->border_colors.focused;
title_texture = child->title_focused;
marks_texture = view->marks_focused;
@ -608,7 +612,11 @@ static void render_container_tabbed(struct sway_output *output,
struct wlr_texture *title_texture;
struct wlr_texture *marks_texture;
if (cstate->focused || parent_focused) {
if (view && view_is_urgent(view)) {
colors = &config->border_colors.urgent;
title_texture = child->title_urgent;
marks_texture = view->marks_urgent;
} else if (cstate->focused || parent_focused) {
colors = &config->border_colors.focused;
title_texture = child->title_focused;
marks_texture = view ? view->marks_focused : NULL;
@ -671,7 +679,11 @@ static void render_container_stacked(struct sway_output *output,
struct wlr_texture *title_texture;
struct wlr_texture *marks_texture;
if (cstate->focused || parent_focused) {
if (view && view_is_urgent(view)) {
colors = &config->border_colors.urgent;
title_texture = child->title_urgent;
marks_texture = view->marks_urgent;
} else if (cstate->focused || parent_focused) {
colors = &config->border_colors.focused;
title_texture = child->title_focused;
marks_texture = view ? view->marks_focused : NULL;
@ -731,7 +743,11 @@ static void render_floating_container(struct sway_output *soutput,
struct wlr_texture *title_texture;
struct wlr_texture *marks_texture;
if (con->current.focused) {
if (view_is_urgent(view)) {
colors = &config->border_colors.urgent;
title_texture = con->title_urgent;
marks_texture = view->marks_urgent;
} else if (con->current.focused) {
colors = &config->border_colors.focused;
title_texture = con->title_focused;
marks_texture = view->marks_focused;