mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	tablet: expose wlr_tablet_tool_v2_has_implicit_grab function
This is necessary so that sway can determine when to start emulating pointer events -- it shouldn't start doing so during an implicit grab, even if the pen is over a surface that doesn't bind tablet input. Refs swaywm/sway#5302.
This commit is contained in:
		
							parent
							
								
									74c0d03f00
								
							
						
					
					
						commit
						7693fdb8a7
					
				
					 2 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -253,6 +253,8 @@ void wlr_tablet_tool_v2_end_grab(struct wlr_tablet_v2_tablet_tool *tool);
 | 
			
		|||
 | 
			
		||||
void wlr_tablet_tool_v2_start_implicit_grab(struct wlr_tablet_v2_tablet_tool *tool);
 | 
			
		||||
 | 
			
		||||
bool wlr_tablet_tool_v2_has_implicit_grab(
 | 
			
		||||
	struct wlr_tablet_v2_tablet_tool *tool);
 | 
			
		||||
 | 
			
		||||
uint32_t wlr_send_tablet_v2_tablet_pad_enter(
 | 
			
		||||
	struct wlr_tablet_v2_tablet_pad *pad,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -822,13 +822,14 @@ static const struct wlr_tablet_tool_v2_grab_interface
 | 
			
		|||
	.cancel = implicit_tool_cancel,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static bool tool_has_implicit_grab(struct wlr_tablet_v2_tablet_tool *tool) {
 | 
			
		||||
bool wlr_tablet_tool_v2_has_implicit_grab(
 | 
			
		||||
		struct wlr_tablet_v2_tablet_tool *tool) {
 | 
			
		||||
	return tool->grab->interface == &implicit_tool_grab_interface;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void wlr_tablet_tool_v2_start_implicit_grab(
 | 
			
		||||
		struct wlr_tablet_v2_tablet_tool *tool) {
 | 
			
		||||
	if (tool_has_implicit_grab(tool) || !tool->focused_surface) {
 | 
			
		||||
	if (wlr_tablet_tool_v2_has_implicit_grab(tool) || !tool->focused_surface) {
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue