mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	commands: move newly-stickied containers to focused workspace
This commit is contained in:
		
							parent
							
								
									b3f7801fca
								
							
						
					
					
						commit
						37e37627ca
					
				
					 1 changed files with 16 additions and 0 deletions
				
			
		| 
						 | 
					@ -36,5 +36,21 @@ struct cmd_results *cmd_sticky(int argc, char **argv) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	container->is_sticky = wants_sticky;
 | 
						container->is_sticky = wants_sticky;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (wants_sticky) {
 | 
				
			||||||
 | 
							// move container to focused workspace
 | 
				
			||||||
 | 
							struct sway_container *output = container_parent(container, C_OUTPUT);
 | 
				
			||||||
 | 
							struct sway_seat *seat = input_manager_current_seat(input_manager);
 | 
				
			||||||
 | 
							struct sway_container *focus = seat_get_focus_inactive(seat, output);
 | 
				
			||||||
 | 
							struct sway_container *focused_workspace = container_parent(focus, C_WORKSPACE);
 | 
				
			||||||
 | 
							struct sway_container *current_workspace = container_parent(container, C_WORKSPACE);
 | 
				
			||||||
 | 
							if (current_workspace != focused_workspace) {
 | 
				
			||||||
 | 
								container_move_to(container, focused_workspace);
 | 
				
			||||||
 | 
								arrange_windows(focused_workspace);
 | 
				
			||||||
 | 
								if (!container_reap_empty(current_workspace)) {
 | 
				
			||||||
 | 
									arrange_windows(current_workspace);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return cmd_results_new(CMD_SUCCESS, NULL, NULL);
 | 
						return cmd_results_new(CMD_SUCCESS, NULL, NULL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue