diff --git a/include/data.h b/include/data.h index 634cca67..4f69706f 100644 --- a/include/data.h +++ b/include/data.h @@ -409,6 +409,11 @@ struct Window { /** Depth of the window */ uint16_t depth; + + /* the wanted size of the window, used in combination with size + * increments (see below). */ + int base_width; + int base_height; }; /** @@ -572,10 +577,6 @@ struct Con { /* aspect ratio from WM_NORMAL_HINTS (MPlayer uses this for example) */ double aspect_ratio; - /* the wanted size of the window, used in combination with size - * increments (see below). */ - int base_width; - int base_height; /* the x11 border pixel attribute */ int border_width; diff --git a/src/floating.c b/src/floating.c index a82e2525..60322c0c 100644 --- a/src/floating.c +++ b/src/floating.c @@ -55,17 +55,17 @@ void floating_check_size(Con *floating_con) { border_rect.height += render_deco_height(); if (focused_con->height_increment && - floating_con->rect.height >= focused_con->base_height + border_rect.height) { - floating_con->rect.height -= focused_con->base_height + border_rect.height; + floating_con->rect.height >= focused_con->window->base_height + border_rect.height) { + floating_con->rect.height -= focused_con->window->base_height + border_rect.height; floating_con->rect.height -= floating_con->rect.height % focused_con->height_increment; - floating_con->rect.height += focused_con->base_height + border_rect.height; + floating_con->rect.height += focused_con->window->base_height + border_rect.height; } if (focused_con->width_increment && - floating_con->rect.width >= focused_con->base_width + border_rect.width) { - floating_con->rect.width -= focused_con->base_width + border_rect.width; + floating_con->rect.width >= focused_con->window->base_width + border_rect.width) { + floating_con->rect.width -= focused_con->window->base_width + border_rect.width; floating_con->rect.width -= floating_con->rect.width % focused_con->width_increment; - floating_con->rect.width += focused_con->base_width + border_rect.width; + floating_con->rect.width += focused_con->window->base_width + border_rect.width; } } diff --git a/src/handlers.c b/src/handlers.c index 1daefbc9..8e92bec9 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -960,10 +960,10 @@ static bool handle_normal_hints(void *data, xcb_connection_t *conn, uint8_t stat base_height = size_hints.min_height; } - if (base_width != con->base_width || - base_height != con->base_height) { - con->base_width = base_width; - con->base_height = base_height; + if (base_width != con->window->base_width || + base_height != con->window->base_height) { + con->window->base_width = base_width; + con->window->base_height = base_height; DLOG("client's base_height changed to %d\n", base_height); DLOG("client's base_width changed to %d\n", base_width); changed = true;