Refactor logic to determine if stacked/tabbed con

Add a new function `swayc_is_tabbed_or_stacked()` to determine whether or not
the given container has layout of stacked or tabbed. This is done commonly
enough that it should have its own method to help readability and code quality.

No logic changes.
This commit is contained in:
Tony Crisci 2016-08-01 22:57:33 -04:00
parent a4096b73c9
commit 02638c1f44
7 changed files with 22 additions and 10 deletions

View file

@ -793,8 +793,7 @@ static void arrange_windows_r(swayc_t *container, double width, double height) {
y = container->y;
// add gaps to top level tapped/stacked container
if (container->parent->type == C_WORKSPACE &&
(container->layout == L_TABBED || container->layout == L_STACKED)) {
if (container->parent->type == C_WORKSPACE && swayc_is_tabbed_or_stacked(container)) {
update_geometry(container);
width = container->border_geometry.size.w;
height = container->border_geometry.size.h;