mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Fix issue #661.
Borders are now drawn correctly (same behavior as i3) for tabbed and stacked containers, when the children have 'border none' set.
This commit is contained in:
		
							parent
							
								
									ae027aad5a
								
							
						
					
					
						commit
						870a7aaad9
					
				
					 2 changed files with 9 additions and 3 deletions
				
			
		| 
						 | 
					@ -402,7 +402,13 @@ void update_view_border(swayc_t *view) {
 | 
				
			||||||
void render_view_borders(wlc_handle view) {
 | 
					void render_view_borders(wlc_handle view) {
 | 
				
			||||||
	swayc_t *c = swayc_by_handle(view);
 | 
						swayc_t *c = swayc_by_handle(view);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!c || c->border_type == B_NONE) {
 | 
					
 | 
				
			||||||
 | 
						// emulate i3 behavior for drawing borders for tabbed and stacked layouts:
 | 
				
			||||||
 | 
						// if we are not the only child in the container, always draw borders,
 | 
				
			||||||
 | 
						// regardless of the border setting on the individual view
 | 
				
			||||||
 | 
						if (!c || (c->border_type == B_NONE
 | 
				
			||||||
 | 
								&& !((c->parent->layout == L_TABBED || c->parent->layout == L_STACKED)
 | 
				
			||||||
 | 
									&& c->parent->children->length > 1))) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -594,7 +594,7 @@ void update_geometry(swayc_t *container) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		int title_bar_height = config->font_height + 4; //borders + padding
 | 
							int title_bar_height = config->font_height + 4; //borders + padding
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (parent->layout == L_TABBED) {
 | 
							if (parent->layout == L_TABBED && parent->children->length > 1) {
 | 
				
			||||||
			int i, x = 0, w, l, r;
 | 
								int i, x = 0, w, l, r;
 | 
				
			||||||
			l = parent->children->length;
 | 
								l = parent->children->length;
 | 
				
			||||||
			w = geometry.size.w / l;
 | 
								w = geometry.size.w / l;
 | 
				
			||||||
| 
						 | 
					@ -625,7 +625,7 @@ void update_geometry(swayc_t *container) {
 | 
				
			||||||
			geometry.size.w -= (border_left + border_right);
 | 
								geometry.size.w -= (border_left + border_right);
 | 
				
			||||||
			geometry.size.h -= (border_bottom + title_bar.size.h);
 | 
								geometry.size.h -= (border_bottom + title_bar.size.h);
 | 
				
			||||||
			container->title_bar_geometry = title_bar;
 | 
								container->title_bar_geometry = title_bar;
 | 
				
			||||||
		} else if (parent->layout == L_STACKED) {
 | 
							} else if (parent->layout == L_STACKED && parent->children->length > 1) {
 | 
				
			||||||
			int i, y = 0;
 | 
								int i, y = 0;
 | 
				
			||||||
			for (i = 0; i < parent->children->length; ++i) {
 | 
								for (i = 0; i < parent->children->length; ++i) {
 | 
				
			||||||
				swayc_t *view = parent->children->items[i];
 | 
									swayc_t *view = parent->children->items[i];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue