diff options
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index c150270e..a25139b4 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -453,7 +453,7 @@ static void render_container_simple_border_pixel(struct sway_output *output, | |||
453 | } | 453 | } |
454 | 454 | ||
455 | static void render_container(struct sway_output *output, | 455 | static void render_container(struct sway_output *output, |
456 | pixman_region32_t *damage, struct sway_container *con); | 456 | pixman_region32_t *damage, struct sway_container *con, bool parent_focused); |
457 | 457 | ||
458 | /** | 458 | /** |
459 | * Render a container's children using a L_HORIZ or L_VERT layout. | 459 | * Render a container's children using a L_HORIZ or L_VERT layout. |
@@ -462,7 +462,8 @@ static void render_container(struct sway_output *output, | |||
462 | * they'll apply their own borders to their children. | 462 | * they'll apply their own borders to their children. |
463 | */ | 463 | */ |
464 | static void render_container_simple(struct sway_output *output, | 464 | static void render_container_simple(struct sway_output *output, |
465 | pixman_region32_t *damage, struct sway_container *con) { | 465 | pixman_region32_t *damage, struct sway_container *con, |
466 | bool parent_focused) { | ||
466 | struct sway_seat *seat = input_manager_current_seat(input_manager); | 467 | struct sway_seat *seat = input_manager_current_seat(input_manager); |
467 | struct sway_container *focus = seat_get_focus(seat); | 468 | struct sway_container *focus = seat_get_focus(seat); |
468 | 469 | ||
@@ -473,7 +474,7 @@ static void render_container_simple(struct sway_output *output, | |||
473 | if (child->sway_view->border != B_NONE) { | 474 | if (child->sway_view->border != B_NONE) { |
474 | struct border_colors *colors; | 475 | struct border_colors *colors; |
475 | struct wlr_texture *title_texture; | 476 | struct wlr_texture *title_texture; |
476 | if (focus == child) { | 477 | if (focus == child || parent_focused) { |
477 | colors = &config->border_colors.focused; | 478 | colors = &config->border_colors.focused; |
478 | title_texture = child->title_focused; | 479 | title_texture = child->title_focused; |
479 | } else if (seat_get_focus_inactive(seat, con) == child) { | 480 | } else if (seat_get_focus_inactive(seat, con) == child) { |
@@ -494,7 +495,8 @@ static void render_container_simple(struct sway_output *output, | |||
494 | } | 495 | } |
495 | render_view(child->sway_view, output, damage); | 496 | render_view(child->sway_view, output, damage); |
496 | } else { | 497 | } else { |
497 | render_container(output, damage, child); | 498 | render_container(output, damage, child, |
499 | parent_focused || focus == child); | ||
498 | } | 500 | } |
499 | } | 501 | } |
500 | } | 502 | } |
@@ -516,12 +518,13 @@ static void render_container_stacked(struct sway_output *output, | |||
516 | } | 518 | } |
517 | 519 | ||
518 | static void render_container(struct sway_output *output, | 520 | static void render_container(struct sway_output *output, |
519 | pixman_region32_t *damage, struct sway_container *con) { | 521 | pixman_region32_t *damage, struct sway_container *con, |
522 | bool parent_focused) { | ||
520 | switch (con->layout) { | 523 | switch (con->layout) { |
521 | case L_NONE: | 524 | case L_NONE: |
522 | case L_HORIZ: | 525 | case L_HORIZ: |
523 | case L_VERT: | 526 | case L_VERT: |
524 | render_container_simple(output, damage, con); | 527 | render_container_simple(output, damage, con, parent_focused); |
525 | break; | 528 | break; |
526 | case L_STACKED: | 529 | case L_STACKED: |
527 | render_container_stacked(output, damage, con); | 530 | render_container_stacked(output, damage, con); |
@@ -605,7 +608,9 @@ static void render_output(struct sway_output *output, struct timespec *when, | |||
605 | render_layer(output, damage, | 608 | render_layer(output, damage, |
606 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); | 609 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); |
607 | 610 | ||
608 | render_container(output, damage, workspace); | 611 | struct sway_seat *seat = input_manager_current_seat(input_manager); |
612 | struct sway_container *focus = seat_get_focus(seat); | ||
613 | render_container(output, damage, workspace, focus == workspace); | ||
609 | 614 | ||
610 | render_unmanaged(output, damage, | 615 | render_unmanaged(output, damage, |
611 | &root_container.sway_root->xwayland_unmanaged); | 616 | &root_container.sway_root->xwayland_unmanaged); |