mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	seat: Only resend keyboard/pointer enter to focused clients
Otherwise it will send enter events to clients that already have keyboard/pointer focus. Notably Qt applications warns about this.
This commit is contained in:
		
							parent
							
								
									1c3e0816f3
								
							
						
					
					
						commit
						31914928d2
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -415,7 +415,7 @@ void seat_client_create_keyboard(struct wlr_seat_client *seat_client,
 | 
				
			||||||
		seat_client->seat->keyboard_state.focused_surface;
 | 
							seat_client->seat->keyboard_state.focused_surface;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Send an enter event if there is a focused client/surface stored
 | 
						// Send an enter event if there is a focused client/surface stored
 | 
				
			||||||
	if (focused_client != NULL && focused_surface != NULL) {
 | 
						if (focused_client == seat_client && focused_surface != NULL) {
 | 
				
			||||||
		uint32_t *keycodes = keyboard->keycodes;
 | 
							uint32_t *keycodes = keyboard->keycodes;
 | 
				
			||||||
		size_t num_keycodes = keyboard->num_keycodes;
 | 
							size_t num_keycodes = keyboard->num_keycodes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -446,7 +446,7 @@ void seat_client_create_pointer(struct wlr_seat_client *seat_client,
 | 
				
			||||||
		seat_client->seat->pointer_state.focused_surface;
 | 
							seat_client->seat->pointer_state.focused_surface;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Send an enter event if there is a focused client/surface stored
 | 
						// Send an enter event if there is a focused client/surface stored
 | 
				
			||||||
	if (focused_client != NULL && focused_surface != NULL) {
 | 
						if (focused_client == seat_client && focused_surface != NULL) {
 | 
				
			||||||
		double sx = seat_client->seat->pointer_state.sx;
 | 
							double sx = seat_client->seat->pointer_state.sx;
 | 
				
			||||||
		double sy = seat_client->seat->pointer_state.sy;
 | 
							double sy = seat_client->seat->pointer_state.sy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue