mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	xdg-popup: don't set a role resource destroy handler
wlr_xdg_surface tracks role resource destruction itself.
This commit is contained in:
		
							parent
							
								
									6c8eabcecd
								
							
						
					
					
						commit
						c52e01e85f
					
				
					 1 changed files with 1 additions and 11 deletions
				
			
		| 
						 | 
					@ -361,15 +361,6 @@ static const struct wlr_surface_synced_impl surface_synced_impl = {
 | 
				
			||||||
	.state_size = sizeof(struct wlr_xdg_popup_state),
 | 
						.state_size = sizeof(struct wlr_xdg_popup_state),
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void xdg_popup_handle_resource_destroy(struct wl_resource *resource) {
 | 
					 | 
				
			||||||
	struct wlr_xdg_popup *popup =
 | 
					 | 
				
			||||||
		wlr_xdg_popup_from_resource(resource);
 | 
					 | 
				
			||||||
	if (popup == NULL) {
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	wlr_xdg_popup_destroy(popup);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void create_xdg_popup(struct wlr_xdg_surface *surface, struct wlr_xdg_surface *parent,
 | 
					void create_xdg_popup(struct wlr_xdg_surface *surface, struct wlr_xdg_surface *parent,
 | 
				
			||||||
		struct wlr_xdg_positioner *positioner, uint32_t id) {
 | 
							struct wlr_xdg_positioner *positioner, uint32_t id) {
 | 
				
			||||||
	if (!wlr_xdg_positioner_is_complete(positioner)) {
 | 
						if (!wlr_xdg_positioner_is_complete(positioner)) {
 | 
				
			||||||
| 
						 | 
					@ -409,8 +400,7 @@ void create_xdg_popup(struct wlr_xdg_surface *surface, struct wlr_xdg_surface *p
 | 
				
			||||||
		goto error_synced;
 | 
							goto error_synced;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	wl_resource_set_implementation(surface->popup->resource,
 | 
						wl_resource_set_implementation(surface->popup->resource,
 | 
				
			||||||
		&xdg_popup_implementation, surface->popup,
 | 
							&xdg_popup_implementation, surface->popup, NULL);
 | 
				
			||||||
		xdg_popup_handle_resource_destroy);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	surface->role = WLR_XDG_SURFACE_ROLE_POPUP;
 | 
						surface->role = WLR_XDG_SURFACE_ROLE_POPUP;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue