@@ -60,6 +60,7 @@ int border_width = 2;
6060int window_gap = 10 ;
6161bool smart_gaps = false;
6262bool smart_borders = false;
63+ bool respect_tiled_min_size = false;
6364bool focus_wrapping = true;
6465int focus_on_activate = FOCUS_ON_ACTIVATE_FOCUS ;
6566double split_ratio = 0.5 ;
@@ -387,7 +388,7 @@ static void render_leaf(output_t *m, desktop_t *d, node_t *n, struct wlr_box rec
387388 }
388389
389390 // clamp up to constraints and center within the tile slot
390- if (use_centering ) {
391+ if (respect_tiled_min_size && use_centering ) {
391392 if ((int )n -> constraints .min_width > MIN_WIDTH && r .width < (int )n -> constraints .min_width &&
392393 slot .width > 0 ) {
393394 r .x = slot .x + (slot .width - (int )n -> constraints .min_width ) / 2 ;
@@ -527,15 +528,20 @@ static void compute_split_rects(node_t *n, desktop_t *d, struct wlr_box rect,
527528 * first_rect = rect ;
528529 * second_rect = rect ;
529530
531+ uint16_t first_min_w = respect_tiled_min_size &&
532+ n -> first_child ? n -> first_child -> constraints .min_width : 0 ;
533+ uint16_t second_min_w = respect_tiled_min_size &&
534+ n -> second_child ? n -> second_child -> constraints .min_width : 0 ;
535+ uint16_t first_min_h = respect_tiled_min_size &&
536+ n -> first_child ? n -> first_child -> constraints .min_height : 0 ;
537+ uint16_t second_min_h = respect_tiled_min_size &&
538+ n -> second_child ? n -> second_child -> constraints .min_height : 0 ;
539+
530540 if (n -> split_type == TYPE_VERTICAL ) {
531- split_dimension (rect .width , n -> split_ratio ,
532- n -> first_child ? n -> first_child -> constraints .min_width : 0 ,
533- n -> second_child ? n -> second_child -> constraints .min_width : 0 , & first_rect -> width ,
541+ split_dimension (rect .width , n -> split_ratio , first_min_w , second_min_w , & first_rect -> width ,
534542 & second_rect -> width , & second_rect -> x );
535543 } else {
536- split_dimension (rect .height , n -> split_ratio ,
537- n -> first_child ? n -> first_child -> constraints .min_height : 0 ,
538- n -> second_child ? n -> second_child -> constraints .min_height : 0 , & first_rect -> height ,
544+ split_dimension (rect .height , n -> split_ratio , first_min_h , second_min_h , & first_rect -> height ,
539545 & second_rect -> height , & second_rect -> y );
540546 }
541547}
0 commit comments