From 7878de5ccc223baa609770e04efa151f5b99b16d Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Wed, 30 Mar 2016 00:13:39 +0200 Subject: [PATCH] Mark focused view focus_inactive on unfocused output --- include/border.h | 1 + sway/border.c | 6 ++++++ sway/focus.c | 2 ++ 3 files changed, 9 insertions(+) diff --git a/include/border.h b/include/border.h index 63cd63d29..85c656e08 100644 --- a/include/border.h +++ b/include/border.h @@ -5,6 +5,7 @@ void render_view_borders(wlc_handle view); void update_view_border(swayc_t *view); +void map_update_view_border(swayc_t *view, void *data); int get_font_text_height(const char *font); #endif diff --git a/sway/border.c b/sway/border.c index 872e8d34b..e820794f8 100644 --- a/sway/border.c +++ b/sway/border.c @@ -170,6 +170,12 @@ static void render_with_title_bar(swayc_t *view, cairo_t *cr, struct border_colo view->actual_geometry.size.w, 1); } +void map_update_view_border(swayc_t *view, void *data) { + if (view->type == C_VIEW) { + update_view_border(view); + } +} + void update_view_border(swayc_t *view) { cairo_t *cr = NULL; cairo_surface_t *surface = NULL; diff --git a/sway/focus.c b/sway/focus.c index 4cae3b472..0c9719b09 100644 --- a/sway/focus.c +++ b/sway/focus.c @@ -29,6 +29,8 @@ static void update_focus(swayc_t *c) { // Case where output changes case C_OUTPUT: + // update borders for views in prev + container_map(prev, map_update_view_border, NULL); wlc_output_focus(c->handle); break;