mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Added focus following for touch_down
This commit is contained in:
		
							parent
							
								
									484f7677b0
								
							
						
					
					
						commit
						798fc24081
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
					@ -368,6 +368,12 @@ static void handle_touch_down(struct wl_listener *listener, void *data) {
 | 
				
			||||||
				event->touch_id, sx, sy);
 | 
									event->touch_id, sx, sy);
 | 
				
			||||||
		cursor_hide(cursor);
 | 
							cursor_hide(cursor);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						//move cursor so focus follows touch
 | 
				
			||||||
 | 
						float delta_x = lx - cursor->cursor->x;
 | 
				
			||||||
 | 
						float delta_y = ly - cursor->cursor->y;
 | 
				
			||||||
 | 
						cursor_motion(cursor, 0, event->device, delta_x,
 | 
				
			||||||
 | 
							      delta_y, delta_x, delta_y);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void handle_touch_up(struct wl_listener *listener, void *data) {
 | 
					static void handle_touch_up(struct wl_listener *listener, void *data) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue