mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Fix focus follows mouse with no focus
This commit is contained in:
		
							parent
							
								
									54818a1c98
								
							
						
					
					
						commit
						8bbf78fdd4
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -147,10 +147,10 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
 | 
				
			||||||
	struct sway_container *c = container_at_coords(cursor->seat,
 | 
						struct sway_container *c = container_at_coords(cursor->seat,
 | 
				
			||||||
			cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy);
 | 
								cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy);
 | 
				
			||||||
	if (c && config->focus_follows_mouse && allow_refocusing) {
 | 
						if (c && config->focus_follows_mouse && allow_refocusing) {
 | 
				
			||||||
		if (c->type == C_WORKSPACE) {
 | 
							struct sway_container *focus = seat_get_focus(cursor->seat);
 | 
				
			||||||
 | 
							if (focus && c->type == C_WORKSPACE) {
 | 
				
			||||||
			// Only follow the mouse if it would move to a new output
 | 
								// Only follow the mouse if it would move to a new output
 | 
				
			||||||
			// Otherwise we'll focus the workspace, which is probably wrong
 | 
								// Otherwise we'll focus the workspace, which is probably wrong
 | 
				
			||||||
			struct sway_container *focus = seat_get_focus(cursor->seat);
 | 
					 | 
				
			||||||
			if (focus->type != C_OUTPUT) {
 | 
								if (focus->type != C_OUTPUT) {
 | 
				
			||||||
				focus = container_parent(focus, C_OUTPUT);
 | 
									focus = container_parent(focus, C_OUTPUT);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue