xcb_flush(conn);
}
-/**
+/*
* Called when a floating window is created or resized.
* This function resizes the window if its size is higher or lower than the
* configured maximum/minimum size, respectively.
floating_con->rect.height += border_rect.height;
}
+ if (focused_con->window->max_width) {
+ floating_con->rect.width -= border_rect.width;
+ floating_con->rect.width = min(floating_con->rect.width, focused_con->window->max_width);
+ floating_con->rect.width += border_rect.width;
+ }
+
+ if (focused_con->window->max_height) {
+ floating_con->rect.height -= border_rect.height;
+ floating_con->rect.height = min(floating_con->rect.height, focused_con->window->max_height);
+ floating_con->rect.height += border_rect.height;
+ }
+
if (focused_con->window->height_increment &&
floating_con->rect.height >= focused_con->window->base_height + border_rect.height) {
floating_con->rect.height -= focused_con->window->base_height + border_rect.height;
con->rect = newrect;
- floating_maybe_reassign_ws(con);
+ bool reassigned = floating_maybe_reassign_ws(con);
/* If this is a scratchpad window, don't auto center it from now on. */
if (con->scratchpad_state == SCRATCHPAD_FRESH)
con->scratchpad_state = SCRATCHPAD_CHANGED;
- tree_render();
+ /* Workspace change will already result in a tree_render. */
+ if (!reassigned) {
+ render_con(con, false);
+ x_push_node(con);
+ }
return true;
}