mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	Stop listening to cursor surface when manually setting cursor data
This commit is contained in:
		
							parent
							
								
									cebb202f7d
								
							
						
					
					
						commit
						bceaee6eb7
					
				
					 1 changed files with 15 additions and 3 deletions
				
			
		| 
						 | 
					@ -120,9 +120,9 @@ void wlr_output_transform(struct wlr_output *output,
 | 
				
			||||||
	wlr_output_update_matrix(output);
 | 
						wlr_output_update_matrix(output);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool wlr_output_set_cursor(struct wlr_output *output,
 | 
					static bool set_cursor(struct wlr_output *output, const uint8_t *buf,
 | 
				
			||||||
		const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height,
 | 
							int32_t stride, uint32_t width, uint32_t height, int32_t hotspot_x,
 | 
				
			||||||
		int32_t hotspot_x, int32_t hotspot_y) {
 | 
							int32_t hotspot_y) {
 | 
				
			||||||
	if (output->impl->set_cursor
 | 
						if (output->impl->set_cursor
 | 
				
			||||||
			&& output->impl->set_cursor(output, buf, stride, width, height,
 | 
								&& output->impl->set_cursor(output, buf, stride, width, height,
 | 
				
			||||||
				hotspot_x, hotspot_y)) {
 | 
									hotspot_x, hotspot_y)) {
 | 
				
			||||||
| 
						 | 
					@ -158,6 +158,18 @@ bool wlr_output_set_cursor(struct wlr_output *output,
 | 
				
			||||||
		WL_SHM_FORMAT_ARGB8888, stride, width, height, buf);
 | 
							WL_SHM_FORMAT_ARGB8888, stride, width, height, buf);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool wlr_output_set_cursor(struct wlr_output *output,
 | 
				
			||||||
 | 
							const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height,
 | 
				
			||||||
 | 
							int32_t hotspot_x, int32_t hotspot_y) {
 | 
				
			||||||
 | 
						if (output->cursor.surface) {
 | 
				
			||||||
 | 
							wl_list_remove(&output->cursor.surface_commit.link);
 | 
				
			||||||
 | 
							wl_list_remove(&output->cursor.surface_destroy.link);
 | 
				
			||||||
 | 
							output->cursor.surface = NULL;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return set_cursor(output, buf, stride, width, height, hotspot_x, hotspot_y);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void handle_cursor_surface_commit(struct wl_listener *listener,
 | 
					static void handle_cursor_surface_commit(struct wl_listener *listener,
 | 
				
			||||||
		void *data) {
 | 
							void *data) {
 | 
				
			||||||
	struct wlr_output *output = wl_container_of(listener, output,
 | 
						struct wlr_output *output = wl_container_of(listener, output,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue