mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Dont try and fullscreen a workspace with no views
Found this completely by accident
This commit is contained in:
		
							parent
							
								
									1f4a590c18
								
							
						
					
					
						commit
						596c4d9428
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
					@ -1435,6 +1435,9 @@ static struct cmd_results *cmd_fullscreen(int argc, char **argv) {
 | 
				
			||||||
		return error;
 | 
							return error;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	swayc_t *container = get_focused_view(&root_container);
 | 
						swayc_t *container = get_focused_view(&root_container);
 | 
				
			||||||
 | 
						if(container->type != C_VIEW){
 | 
				
			||||||
 | 
							return cmd_results_new(CMD_INVALID, "fullscreen", "Only views can fullscreen");
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	swayc_t *workspace = swayc_parent_by_type(container, C_WORKSPACE);
 | 
						swayc_t *workspace = swayc_parent_by_type(container, C_WORKSPACE);
 | 
				
			||||||
	bool current = swayc_is_fullscreen(container);
 | 
						bool current = swayc_is_fullscreen(container);
 | 
				
			||||||
	wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current);
 | 
						wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue