mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	commands: allow tiled containers to be stickied
This also stops stickied containers from losing its sticky status when it is tiled, allowing it to be immediately stickied when floated again.
This commit is contained in:
		
							parent
							
								
									42f8a038c9
								
							
						
					
					
						commit
						34dea3d9d2
					
				
					 3 changed files with 2 additions and 8 deletions
				
			
		| 
						 | 
					@ -22,14 +22,9 @@ struct cmd_results *cmd_sticky(int argc, char **argv) {
 | 
				
			||||||
		return cmd_results_new(CMD_FAILURE, "No current container");
 | 
							return cmd_results_new(CMD_FAILURE, "No current container");
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	if (!container_is_floating(container)) {
 | 
					 | 
				
			||||||
		return cmd_results_new(CMD_FAILURE,
 | 
					 | 
				
			||||||
			"Can't set sticky on a tiled container");
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	container->is_sticky = parse_boolean(argv[0], container->is_sticky);
 | 
						container->is_sticky = parse_boolean(argv[0], container->is_sticky);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (container->is_sticky &&
 | 
						if (container->is_sticky && container_is_floating_or_child(container) &&
 | 
				
			||||||
			(!container->scratchpad || container->workspace)) {
 | 
								(!container->scratchpad || container->workspace)) {
 | 
				
			||||||
		// move container to active workspace
 | 
							// move container to active workspace
 | 
				
			||||||
		struct sway_workspace *active_workspace =
 | 
							struct sway_workspace *active_workspace =
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -708,7 +708,6 @@ void container_set_floating(struct sway_container *container, bool enable) {
 | 
				
			||||||
				container->border = container->saved_border;
 | 
									container->border = container->saved_border;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		container->is_sticky = false;
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	container_end_mouse_operation(container);
 | 
						container_end_mouse_operation(container);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue