mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Make xwayland surface destroy more foolproof
This commit is contained in:
		
							parent
							
								
									7ce1038478
								
							
						
					
					
						commit
						a528aea2ee
					
				
					 1 changed files with 11 additions and 6 deletions
				
			
		| 
						 | 
					@ -176,12 +176,6 @@ static void handle_commit(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	view_damage_from(view);
 | 
						view_damage_from(view);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void handle_destroy(struct wl_listener *listener, void *data) {
 | 
					 | 
				
			||||||
	struct sway_xwayland_view *xwayland_view =
 | 
					 | 
				
			||||||
		wl_container_of(listener, xwayland_view, destroy);
 | 
					 | 
				
			||||||
	view_destroy(&xwayland_view->view);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void handle_unmap(struct wl_listener *listener, void *data) {
 | 
					static void handle_unmap(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	struct sway_xwayland_view *xwayland_view =
 | 
						struct sway_xwayland_view *xwayland_view =
 | 
				
			||||||
		wl_container_of(listener, xwayland_view, unmap);
 | 
							wl_container_of(listener, xwayland_view, unmap);
 | 
				
			||||||
| 
						 | 
					@ -205,6 +199,17 @@ static void handle_map(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	view_map(view, xsurface->surface);
 | 
						view_map(view, xsurface->surface);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void handle_destroy(struct wl_listener *listener, void *data) {
 | 
				
			||||||
 | 
						struct sway_xwayland_view *xwayland_view =
 | 
				
			||||||
 | 
							wl_container_of(listener, xwayland_view, destroy);
 | 
				
			||||||
 | 
						struct sway_view *view = &xwayland_view->view;
 | 
				
			||||||
 | 
						struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
 | 
				
			||||||
 | 
						if (xsurface->mapped) {
 | 
				
			||||||
 | 
							handle_unmap(&xwayland_view->unmap, xsurface);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						view_destroy(&xwayland_view->view);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void handle_request_configure(struct wl_listener *listener, void *data) {
 | 
					static void handle_request_configure(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	struct sway_xwayland_view *xwayland_view =
 | 
						struct sway_xwayland_view *xwayland_view =
 | 
				
			||||||
		wl_container_of(listener, xwayland_view, request_configure);
 | 
							wl_container_of(listener, xwayland_view, request_configure);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue