mirror of
https://github.com/swaywm/sway.git
synced 2025-11-09 13:29:49 -05:00
refactor swayc_tabbed_stacked_parent into _ancestor and _parent and use where needed
This commit is contained in:
parent
7aeedf0264
commit
ad7605675e
7 changed files with 24 additions and 7 deletions
|
|
@ -878,7 +878,7 @@ void close_views(swayc_t *container) {
|
|||
container_map(container, close_view, NULL);
|
||||
}
|
||||
|
||||
swayc_t *swayc_tabbed_stacked_parent(swayc_t *view) {
|
||||
swayc_t *swayc_tabbed_stacked_ancestor(swayc_t *view) {
|
||||
swayc_t *parent = NULL;
|
||||
if (!ASSERT_NONNULL(view)) {
|
||||
return NULL;
|
||||
|
|
@ -892,3 +892,13 @@ swayc_t *swayc_tabbed_stacked_parent(swayc_t *view) {
|
|||
|
||||
return parent;
|
||||
}
|
||||
|
||||
swayc_t *swayc_tabbed_stacked_parent(swayc_t *con) {
|
||||
if (!ASSERT_NONNULL(con)) {
|
||||
return NULL;
|
||||
}
|
||||
if (con->parent && (con->parent->layout == L_TABBED || con->parent->layout == L_STACKED)) {
|
||||
return con->parent;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue