aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/render.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-15 22:43:33 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-16 08:19:25 +1000
commit315d5311b2004b9e148e7b52a7de161b6dfe3878 (patch)
tree1a70d1d73cbffb26bf432c1c7b395ee996651ad3 /sway/desktop/render.c
parentMerge pull request #2280 from ianyfan/leaks (diff)
downloadsway-315d5311b2004b9e148e7b52a7de161b6dfe3878.tar.gz
sway-315d5311b2004b9e148e7b52a7de161b6dfe3878.tar.zst
sway-315d5311b2004b9e148e7b52a7de161b6dfe3878.zip
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.
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r--sway/desktop/render.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 17fe823a..3180f8ba 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -553,7 +553,11 @@ static void render_container_simple(struct sway_output *output,
553 struct wlr_texture *marks_texture; 553 struct wlr_texture *marks_texture;
554 struct sway_container_state *state = &child->current; 554 struct sway_container_state *state = &child->current;
555 555
556 if (state->focused || parent_focused) { 556 if (view_is_urgent(view)) {
557 colors = &config->border_colors.urgent;
558 title_texture = child->title_urgent;
559 marks_texture = view->marks_urgent;
560 } else if (state->focused || parent_focused) {
557 colors = &config->border_colors.focused; 561 colors = &config->border_colors.focused;
558 title_texture = child->title_focused; 562 title_texture = child->title_focused;
559 marks_texture = view->marks_focused; 563 marks_texture = view->marks_focused;
@@ -608,7 +612,11 @@ static void render_container_tabbed(struct sway_output *output,
608 struct wlr_texture *title_texture; 612 struct wlr_texture *title_texture;
609 struct wlr_texture *marks_texture; 613 struct wlr_texture *marks_texture;
610 614
611 if (cstate->focused || parent_focused) { 615 if (view && view_is_urgent(view)) {
616 colors = &config->border_colors.urgent;
617 title_texture = child->title_urgent;
618 marks_texture = view->marks_urgent;
619 } else if (cstate->focused || parent_focused) {
612 colors = &config->border_colors.focused; 620 colors = &config->border_colors.focused;
613 title_texture = child->title_focused; 621 title_texture = child->title_focused;
614 marks_texture = view ? view->marks_focused : NULL; 622 marks_texture = view ? view->marks_focused : NULL;
@@ -671,7 +679,11 @@ static void render_container_stacked(struct sway_output *output,
671 struct wlr_texture *title_texture; 679 struct wlr_texture *title_texture;
672 struct wlr_texture *marks_texture; 680 struct wlr_texture *marks_texture;
673 681
674 if (cstate->focused || parent_focused) { 682 if (view && view_is_urgent(view)) {
683 colors = &config->border_colors.urgent;
684 title_texture = child->title_urgent;
685 marks_texture = view->marks_urgent;
686 } else if (cstate->focused || parent_focused) {
675 colors = &config->border_colors.focused; 687 colors = &config->border_colors.focused;
676 title_texture = child->title_focused; 688 title_texture = child->title_focused;
677 marks_texture = view ? view->marks_focused : NULL; 689 marks_texture = view ? view->marks_focused : NULL;
@@ -731,7 +743,11 @@ static void render_floating_container(struct sway_output *soutput,
731 struct wlr_texture *title_texture; 743 struct wlr_texture *title_texture;
732 struct wlr_texture *marks_texture; 744 struct wlr_texture *marks_texture;
733 745
734 if (con->current.focused) { 746 if (view_is_urgent(view)) {
747 colors = &config->border_colors.urgent;
748 title_texture = con->title_urgent;
749 marks_texture = view->marks_urgent;
750 } else if (con->current.focused) {
735 colors = &config->border_colors.focused; 751 colors = &config->border_colors.focused;
736 title_texture = con->title_focused; 752 title_texture = con->title_focused;
737 marks_texture = view->marks_focused; 753 marks_texture = view->marks_focused;