mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Address review feedback
This commit is contained in:
		
							parent
							
								
									46b388995d
								
							
						
					
					
						commit
						d2d050d59c
					
				
					 3 changed files with 5 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -91,6 +91,6 @@ void seat_apply_config(struct sway_seat *seat, struct seat_config *seat_config);
 | 
			
		|||
 | 
			
		||||
struct seat_config *seat_get_config(struct sway_seat *seat);
 | 
			
		||||
 | 
			
		||||
bool seat_allow_input(struct sway_seat *seat, struct wlr_surface *surface);
 | 
			
		||||
bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -146,7 +146,7 @@ static void cursor_send_pointer_motion(struct sway_cursor *cursor,
 | 
			
		|||
 | 
			
		||||
	// send pointer enter/leave
 | 
			
		||||
	if (surface != NULL) {
 | 
			
		||||
		if (seat_allow_input(cursor->seat, surface)) {
 | 
			
		||||
		if (seat_is_input_allowed(cursor->seat, surface)) {
 | 
			
		||||
			wlr_seat_pointer_notify_enter(seat, surface, sx, sy);
 | 
			
		||||
			wlr_seat_pointer_notify_motion(seat, time, sx, sy);
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -353,7 +353,8 @@ void seat_configure_xcursor(struct sway_seat *seat) {
 | 
			
		|||
		seat->cursor->cursor->y);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool seat_allow_input(struct sway_seat *seat, struct wlr_surface *surface) {
 | 
			
		||||
bool seat_is_input_allowed(struct sway_seat *seat,
 | 
			
		||||
		struct wlr_surface *surface) {
 | 
			
		||||
	struct wl_client *client = wl_resource_get_client(surface->resource);
 | 
			
		||||
	return !seat->exclusive_client || seat->exclusive_client == client;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -379,7 +380,7 @@ void seat_set_focus_warp(struct sway_seat *seat,
 | 
			
		|||
		wl_list_remove(&seat_con->link);
 | 
			
		||||
		wl_list_insert(&seat->focus_stack, &seat_con->link);
 | 
			
		||||
 | 
			
		||||
		if (container->type == C_VIEW && !seat_allow_input(
 | 
			
		||||
		if (container->type == C_VIEW && !seat_is_input_allowed(
 | 
			
		||||
					seat, container->sway_view->surface)) {
 | 
			
		||||
			wlr_log(L_DEBUG, "Refusing to set focus, input is inhibited");
 | 
			
		||||
			return;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue