mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	wayland backend: emit signal for input/output removal
This commit is contained in:
		
							parent
							
								
									c323bfc6a0
								
							
						
					
					
						commit
						8427749dd0
					
				
					 3 changed files with 7 additions and 4 deletions
				
			
		| 
						 | 
					@ -46,6 +46,7 @@ static void wlr_wl_output_transform(struct wlr_output_state *output,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void wlr_wl_output_destroy(struct wlr_output_state *output) {
 | 
					static void wlr_wl_output_destroy(struct wlr_output_state *output) {
 | 
				
			||||||
 | 
						wl_signal_emit(&output->backend->backend->events.output_remove, output->wlr_output);
 | 
				
			||||||
	if(output->frame_callback) wl_callback_destroy(output->frame_callback);
 | 
						if(output->frame_callback) wl_callback_destroy(output->frame_callback);
 | 
				
			||||||
	eglDestroySurface(output->backend->egl.display, output->surface);
 | 
						eglDestroySurface(output->backend->egl.display, output->surface);
 | 
				
			||||||
	wl_egl_window_destroy(output->egl_window);
 | 
						wl_egl_window_destroy(output->egl_window);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -169,6 +169,7 @@ static struct wl_keyboard_listener keyboard_listener = {
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void input_device_destroy(struct wlr_input_device_state *state) {
 | 
					static void input_device_destroy(struct wlr_input_device_state *state) {
 | 
				
			||||||
 | 
						wl_signal_emit(&state->backend->backend->events.input_remove, state->wlr_device);
 | 
				
			||||||
	if (state->resource)
 | 
						if (state->resource)
 | 
				
			||||||
		wl_proxy_destroy(state->resource);
 | 
							wl_proxy_destroy(state->resource);
 | 
				
			||||||
	free(state);
 | 
						free(state);
 | 
				
			||||||
| 
						 | 
					@ -206,7 +207,7 @@ static struct wlr_input_device *allocate_device(struct wlr_backend_state *state,
 | 
				
			||||||
		free(devstate);
 | 
							free(devstate);
 | 
				
			||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						devstate->wlr_device = wlr_device;
 | 
				
			||||||
	list_add(state->devices, wlr_device);
 | 
						list_add(state->devices, wlr_device);
 | 
				
			||||||
	return wlr_device;
 | 
						return wlr_device;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,13 +33,14 @@ struct wlr_output_state {
 | 
				
			||||||
	struct wlr_output *wlr_output;
 | 
						struct wlr_output *wlr_output;
 | 
				
			||||||
	struct wl_surface *surface;
 | 
						struct wl_surface *surface;
 | 
				
			||||||
	struct wl_shell_surface *shell_surface;
 | 
						struct wl_shell_surface *shell_surface;
 | 
				
			||||||
	struct wl_egl_window* egl_window;
 | 
						struct wl_egl_window *egl_window;
 | 
				
			||||||
	struct wl_callback* frame_callback;
 | 
						struct wl_callback *frame_callback;
 | 
				
			||||||
	void *egl_surface;
 | 
						void *egl_surface;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct wlr_input_device_state {
 | 
					struct wlr_input_device_state {
 | 
				
			||||||
	struct wlr_backend_state* backend;
 | 
						struct wlr_backend_state *backend;
 | 
				
			||||||
 | 
						struct wlr_input_device *wlr_device;
 | 
				
			||||||
	void *resource;
 | 
						void *resource;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue