mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Use wlr_xdg_popup_get_toplevel_coords
This commit is contained in:
		
							parent
							
								
									1059e173f4
								
							
						
					
					
						commit
						59ba528bd9
					
				
					 2 changed files with 10 additions and 14 deletions
				
			
		| 
						 | 
					@ -24,13 +24,11 @@ static void popup_get_root_coords(struct sway_view_child *child,
 | 
				
			||||||
		int *root_sx, int *root_sy) {
 | 
							int *root_sx, int *root_sy) {
 | 
				
			||||||
	struct sway_xdg_popup *popup = (struct sway_xdg_popup *)child;
 | 
						struct sway_xdg_popup *popup = (struct sway_xdg_popup *)child;
 | 
				
			||||||
	struct wlr_xdg_surface *surface = popup->wlr_xdg_surface;
 | 
						struct wlr_xdg_surface *surface = popup->wlr_xdg_surface;
 | 
				
			||||||
	*root_sx = -surface->geometry.x;
 | 
					
 | 
				
			||||||
	*root_sy = -surface->geometry.y;
 | 
						wlr_xdg_popup_get_toplevel_coords(surface->popup,
 | 
				
			||||||
	while (surface && surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
 | 
							-surface->geometry.x + surface->popup->geometry.x,
 | 
				
			||||||
		*root_sx += surface->popup->geometry.x;
 | 
							-surface->geometry.y + surface->popup->geometry.y,
 | 
				
			||||||
		*root_sy += surface->popup->geometry.y;
 | 
							root_sx, root_sy);
 | 
				
			||||||
		surface = wlr_xdg_surface_from_wlr_surface(surface->popup->parent);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void popup_destroy(struct sway_view_child *child) {
 | 
					static void popup_destroy(struct sway_view_child *child) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,13 +23,11 @@ static void popup_get_root_coords(struct sway_view_child *child,
 | 
				
			||||||
		int *root_sx, int *root_sy) {
 | 
							int *root_sx, int *root_sy) {
 | 
				
			||||||
	struct sway_xdg_popup_v6 *popup = (struct sway_xdg_popup_v6 *)child;
 | 
						struct sway_xdg_popup_v6 *popup = (struct sway_xdg_popup_v6 *)child;
 | 
				
			||||||
	struct wlr_xdg_surface_v6 *surface = popup->wlr_xdg_surface_v6;
 | 
						struct wlr_xdg_surface_v6 *surface = popup->wlr_xdg_surface_v6;
 | 
				
			||||||
	*root_sx = -surface->geometry.x;
 | 
					
 | 
				
			||||||
	*root_sy = -surface->geometry.y;
 | 
						wlr_xdg_popup_v6_get_toplevel_coords(surface->popup,
 | 
				
			||||||
	while (surface && surface->role == WLR_XDG_SURFACE_V6_ROLE_POPUP) {
 | 
							-surface->geometry.x + surface->popup->geometry.x,
 | 
				
			||||||
		*root_sx += surface->popup->geometry.x;
 | 
							-surface->geometry.y + surface->popup->geometry.y,
 | 
				
			||||||
		*root_sy += surface->popup->geometry.y;
 | 
							root_sx, root_sy);
 | 
				
			||||||
		surface = surface->popup->parent;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void popup_destroy(struct sway_view_child *child) {
 | 
					static void popup_destroy(struct sway_view_child *child) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue