mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	view: take into account top-margin for xwayland views
...in order to center accurately.
This commit is contained in:
		
							parent
							
								
									d1e16c5030
								
							
						
					
					
						commit
						0f22613952
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -154,6 +154,15 @@ view_compute_centered_position(struct view *view, int w, int h, int *x, int *y)
 | 
			
		|||
	int height = h + view->margin.top + view->margin.bottom;
 | 
			
		||||
	*x = usable.x + (usable.width - width) / 2;
 | 
			
		||||
	*y = usable.y + (usable.height - height) / 2;
 | 
			
		||||
 | 
			
		||||
#if HAVE_XWAYLAND
 | 
			
		||||
	/* TODO: refactor xwayland.c functions to get rid of this */
 | 
			
		||||
	if (view->type == LAB_XWAYLAND_VIEW) {
 | 
			
		||||
		*x += view->margin.left;
 | 
			
		||||
		*y += view->margin.top;
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue