mirror of
https://github.com/swaywm/sway.git
synced 2026-04-27 06:46:25 -04:00
Render active child last in linear tiling containers
This makes it so that if the "active" child has subsurfaces that extend beyond the bounding box of the view, those are drawn above other children. The idea is that you can interact with these subsurfaces (such as GTK popovers) as long as the view is focused (or at least was the last focused child in the container). Relates to #4924
This commit is contained in:
parent
3648b6dea2
commit
f0d712840a
1 changed files with 48 additions and 37 deletions
|
|
@ -667,17 +667,9 @@ struct parent_data {
|
||||||
static void render_container(struct sway_output *output,
|
static void render_container(struct sway_output *output,
|
||||||
pixman_region32_t *damage, struct sway_container *con, bool parent_focused);
|
pixman_region32_t *damage, struct sway_container *con, bool parent_focused);
|
||||||
|
|
||||||
/**
|
static void render_containers_linear_child(struct sway_container *child,
|
||||||
* Render a container's children using a L_HORIZ or L_VERT layout.
|
struct sway_output *output, pixman_region32_t *damage,
|
||||||
*
|
struct parent_data *parent) {
|
||||||
* Wrap child views in borders and leave child containers borderless because
|
|
||||||
* they'll apply their own borders to their children.
|
|
||||||
*/
|
|
||||||
static void render_containers_linear(struct sway_output *output,
|
|
||||||
pixman_region32_t *damage, struct parent_data *parent) {
|
|
||||||
for (int i = 0; i < parent->children->length; ++i) {
|
|
||||||
struct sway_container *child = parent->children->items[i];
|
|
||||||
|
|
||||||
if (child->view) {
|
if (child->view) {
|
||||||
struct sway_view *view = child->view;
|
struct sway_view *view = child->view;
|
||||||
struct border_colors *colors;
|
struct border_colors *colors;
|
||||||
|
|
@ -716,6 +708,25 @@ static void render_containers_linear(struct sway_output *output,
|
||||||
parent->focused || child->current.focused);
|
parent->focused || child->current.focused);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render a container's children using a L_HORIZ or L_VERT layout.
|
||||||
|
*
|
||||||
|
* Wrap child views in borders and leave child containers borderless because
|
||||||
|
* they'll apply their own borders to their children.
|
||||||
|
*/
|
||||||
|
static void render_containers_linear(struct sway_output *output,
|
||||||
|
pixman_region32_t *damage, struct parent_data *parent) {
|
||||||
|
struct sway_container *active = parent->active_child;
|
||||||
|
for (int i = 0; i < parent->children->length; ++i) {
|
||||||
|
struct sway_container *child = parent->children->items[i];
|
||||||
|
if (child != active) {
|
||||||
|
render_containers_linear_child(child, output, damage, parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Render the active child last, to make sure any subsurfaces for that container
|
||||||
|
// are rendered on top
|
||||||
|
render_containers_linear_child(active, output, damage, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue