mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	Add wlr_surface_accepts_touch
This commit is contained in:
		
							parent
							
								
									11e94c406b
								
							
						
					
					
						commit
						e3343cf7d1
					
				
					 2 changed files with 14 additions and 0 deletions
				
			
		| 
						 | 
					@ -678,4 +678,9 @@ struct wlr_seat_client *wlr_seat_client_from_resource(
 | 
				
			||||||
struct wlr_seat_client *wlr_seat_client_from_pointer_resource(
 | 
					struct wlr_seat_client *wlr_seat_client_from_pointer_resource(
 | 
				
			||||||
	struct wl_resource *resource);
 | 
						struct wl_resource *resource);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Check whether a surface has bound to touch events.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					bool wlr_surface_accepts_touch(struct wlr_seat *wlr_seat, struct wlr_surface *surface);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -403,3 +403,12 @@ bool wlr_seat_validate_touch_grab_serial(struct wlr_seat *seat,
 | 
				
			||||||
		"invalid origin surface");
 | 
							"invalid origin surface");
 | 
				
			||||||
	return false;
 | 
						return false;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool wlr_surface_accepts_touch(struct wlr_seat *wlr_seat, struct wlr_surface *surface) {
 | 
				
			||||||
 | 
						struct wl_client *client = wl_resource_get_client(surface->resource);
 | 
				
			||||||
 | 
						struct wlr_seat_client *seat_client = wlr_seat_client_for_wl_client(wlr_seat, client);
 | 
				
			||||||
 | 
						if (!seat_client) {
 | 
				
			||||||
 | 
							return false;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return !wl_list_empty(&seat_client->touches);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue