@ -352,7 +352,8 @@ static void ipc_json_describe_workspace(struct sway_workspace *workspace,
static void get_deco_rect ( struct sway_container * c , struct wlr_box * deco_rect ) {
static void get_deco_rect ( struct sway_container * c , struct wlr_box * deco_rect ) {
enum sway_container_layout parent_layout = container_parent_layout ( c ) ;
enum sway_container_layout parent_layout = container_parent_layout ( c ) ;
if ( ( parent_layout ! = L_TABBED & & parent_layout ! = L_STACKED & &
bool tab_or_stack = parent_layout = = L_TABBED | | parent_layout = = L_STACKED ;
if ( ( ( ! tab_or_stack | | container_is_floating ( c ) ) & &
c - > current . border ! = B_NORMAL ) | |
c - > current . border ! = B_NORMAL ) | |
c - > fullscreen_mode ! = FULLSCREEN_NONE | |
c - > fullscreen_mode ! = FULLSCREEN_NONE | |
c - > workspace = = NULL ) {
c - > workspace = = NULL ) {
@ -370,18 +371,20 @@ static void get_deco_rect(struct sway_container *c, struct wlr_box *deco_rect) {
deco_rect - > width = c - > width ;
deco_rect - > width = c - > width ;
deco_rect - > height = container_titlebar_height ( ) ;
deco_rect - > height = container_titlebar_height ( ) ;
if ( ! container_is_floating ( c ) ) {
if ( parent_layout = = L_TABBED ) {
if ( parent_layout = = L_TABBED ) {
deco_rect - > width = c - > parent
deco_rect - > width = c - > parent
? c - > parent - > width / c - > parent - > children - > length
? c - > parent - > width / c - > parent - > children - > length
: c - > workspace - > width / c - > workspace - > tiling - > length ;
: c - > workspace - > width / c - > workspace - > tiling - > length ;
deco_rect - > x + = deco_rect - > width * container_sibling_index ( c ) ;
deco_rect - > x + = deco_rect - > width * container_sibling_index ( c ) ;
} else if ( container_parent_layout ( c ) = = L_STACKED ) {
} else if ( parent_layout = = L_STACKED ) {
if ( ! c - > view ) {
if ( ! c - > view ) {
size_t siblings = container_get_siblings ( c ) - > length ;
size_t siblings = container_get_siblings ( c ) - > length ;
deco_rect - > y - = deco_rect - > height * siblings ;
deco_rect - > y - = deco_rect - > height * siblings ;
}
}
deco_rect - > y + = deco_rect - > height * container_sibling_index ( c ) ;
deco_rect - > y + = deco_rect - > height * container_sibling_index ( c ) ;
}
}
}
}
}
static void ipc_json_describe_view ( struct sway_container * c , json_object * object ) {
static void ipc_json_describe_view ( struct sway_container * c , json_object * object ) {