mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	fixed vanishing floating view
This commit is contained in:
		
							parent
							
								
									1fd5962aeb
								
							
						
					
					
						commit
						36cd180f02
					
				
					 2 changed files with 10 additions and 8 deletions
				
			
		| 
						 | 
					@ -299,7 +299,8 @@ swayc_t *destroy_workspace(swayc_t *workspace) {
 | 
				
			||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (workspace->children->length == 0) {
 | 
						// Do not destroy if there are children
 | 
				
			||||||
 | 
						if (workspace->children->length == 0 && workspace->floating->length == 0) {
 | 
				
			||||||
		sway_log(L_DEBUG, "%s: '%s'", __func__, workspace->name);
 | 
							sway_log(L_DEBUG, "%s: '%s'", __func__, workspace->name);
 | 
				
			||||||
		swayc_t *parent = workspace->parent;
 | 
							swayc_t *parent = workspace->parent;
 | 
				
			||||||
		free_swayc(workspace);
 | 
							free_swayc(workspace);
 | 
				
			||||||
| 
						 | 
					@ -466,14 +467,16 @@ bool swayc_is_fullscreen(swayc_t *view) {
 | 
				
			||||||
// Mapping
 | 
					// Mapping
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) {
 | 
					void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) {
 | 
				
			||||||
	if (container && container->children && container->children->length)  {
 | 
						if (container) {
 | 
				
			||||||
		int i;
 | 
							int i;
 | 
				
			||||||
		for (i = 0; i < container->children->length; ++i) {
 | 
							if (container->children)  {
 | 
				
			||||||
			swayc_t *child = container->children->items[i];
 | 
								for (i = 0; i < container->children->length; ++i) {
 | 
				
			||||||
			f(child, data);
 | 
									swayc_t *child = container->children->items[i];
 | 
				
			||||||
			container_map(child, f, data);
 | 
									f(child, data);
 | 
				
			||||||
 | 
									container_map(child, f, data);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (container->type == C_WORKSPACE) {
 | 
							if (container->floating) {
 | 
				
			||||||
			for (i = 0; i < container->floating->length; ++i) {
 | 
								for (i = 0; i < container->floating->length; ++i) {
 | 
				
			||||||
				swayc_t *child = container->floating->items[i];
 | 
									swayc_t *child = container->floating->items[i];
 | 
				
			||||||
				f(child, data);
 | 
									f(child, data);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,7 +34,6 @@ static void update_focus(swayc_t *c) {
 | 
				
			||||||
				mask = 2;
 | 
									mask = 2;
 | 
				
			||||||
				container_map(c, set_view_visibility, &mask);
 | 
									container_map(c, set_view_visibility, &mask);
 | 
				
			||||||
				wlc_output_set_mask(parent->handle, 2);
 | 
									wlc_output_set_mask(parent->handle, 2);
 | 
				
			||||||
				c->parent->focused = c;
 | 
					 | 
				
			||||||
				destroy_workspace(ws);
 | 
									destroy_workspace(ws);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue