mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	output: add destroy signal for wlr_output_cursor
This commit is contained in:
		
							parent
							
								
									429f06d3f1
								
							
						
					
					
						commit
						8eed857292
					
				
					 2 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
					@ -29,6 +29,10 @@ struct wlr_output_cursor {
 | 
				
			||||||
	struct wlr_surface *surface;
 | 
						struct wlr_surface *surface;
 | 
				
			||||||
	struct wl_listener surface_commit;
 | 
						struct wl_listener surface_commit;
 | 
				
			||||||
	struct wl_listener surface_destroy;
 | 
						struct wl_listener surface_destroy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						struct {
 | 
				
			||||||
 | 
							struct wl_signal destroy;
 | 
				
			||||||
 | 
						} events;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct wlr_output_impl;
 | 
					struct wlr_output_impl;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -694,6 +694,7 @@ struct wlr_output_cursor *wlr_output_cursor_create(struct wlr_output *output) {
 | 
				
			||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	cursor->output = output;
 | 
						cursor->output = output;
 | 
				
			||||||
 | 
						wl_signal_init(&cursor->events.destroy);
 | 
				
			||||||
	wl_list_init(&cursor->surface_commit.link);
 | 
						wl_list_init(&cursor->surface_commit.link);
 | 
				
			||||||
	cursor->surface_commit.notify = output_cursor_handle_commit;
 | 
						cursor->surface_commit.notify = output_cursor_handle_commit;
 | 
				
			||||||
	wl_list_init(&cursor->surface_destroy.link);
 | 
						wl_list_init(&cursor->surface_destroy.link);
 | 
				
			||||||
| 
						 | 
					@ -707,6 +708,7 @@ void wlr_output_cursor_destroy(struct wlr_output_cursor *cursor) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	output_cursor_reset(cursor);
 | 
						output_cursor_reset(cursor);
 | 
				
			||||||
 | 
						wl_signal_emit(&cursor->events.destroy, cursor);
 | 
				
			||||||
	if (cursor->output->hardware_cursor == cursor) {
 | 
						if (cursor->output->hardware_cursor == cursor) {
 | 
				
			||||||
		// If this cursor was the hardware cursor, disable it
 | 
							// If this cursor was the hardware cursor, disable it
 | 
				
			||||||
		if (cursor->output->impl->set_cursor) {
 | 
							if (cursor->output->impl->set_cursor) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue