mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	xwayland-unmanaged: put all surfaces under server->unmanaged_tree
...in order to render all unmanaged surfaces above views just like sway
does it:
e5728052b5/sway/desktop/render.c (L1148)
Fixes issue #367
			
			
This commit is contained in:
		
							parent
							
								
									39cdba36a8
								
							
						
					
					
						commit
						96315def57
					
				
					 1 changed files with 4 additions and 29 deletions
				
			
		| 
						 | 
					@ -22,22 +22,6 @@ unmanaged_handle_commit(struct wl_listener *listener, void *data)
 | 
				
			||||||
	unmanaged->ly = xsurface->y;
 | 
						unmanaged->ly = xsurface->y;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct view *
 | 
					 | 
				
			||||||
parent_view(struct server *server, struct wlr_xwayland_surface *surface)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	struct wlr_xwayland_surface *s = surface;
 | 
					 | 
				
			||||||
	while (s->parent) {
 | 
					 | 
				
			||||||
		s = s->parent;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	struct view *view;
 | 
					 | 
				
			||||||
	wl_list_for_each(view, &server->views, link) {
 | 
					 | 
				
			||||||
		if (view->xwayland_surface == s) {
 | 
					 | 
				
			||||||
			return view;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return NULL;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
unmanaged_handle_map(struct wl_listener *listener, void *data)
 | 
					unmanaged_handle_map(struct wl_listener *listener, void *data)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -57,20 +41,11 @@ unmanaged_handle_map(struct wl_listener *listener, void *data)
 | 
				
			||||||
		seat_focus_surface(&unmanaged->server->seat, xsurface->surface);
 | 
							seat_focus_surface(&unmanaged->server->seat, xsurface->surface);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int lx = unmanaged->lx;
 | 
					 | 
				
			||||||
	int ly = unmanaged->ly;
 | 
					 | 
				
			||||||
	struct wlr_scene_node *parent, *node;
 | 
					 | 
				
			||||||
	struct view *view = parent_view(unmanaged->server, xsurface);
 | 
					 | 
				
			||||||
	if (!view || !view->scene_node) {
 | 
					 | 
				
			||||||
		parent = &unmanaged->server->unmanaged_tree->node;
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		lx -= view->x;
 | 
					 | 
				
			||||||
		ly -= view->y;
 | 
					 | 
				
			||||||
		parent = &view->scene_tree->node;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	/* node will be destroyed automatically once surface is destroyed */
 | 
						/* node will be destroyed automatically once surface is destroyed */
 | 
				
			||||||
	node = &wlr_scene_surface_create(parent, xsurface->surface)->buffer->node;
 | 
						struct wlr_scene_node *node = &wlr_scene_surface_create(
 | 
				
			||||||
	wlr_scene_node_set_position(node, lx, ly);
 | 
								&unmanaged->server->unmanaged_tree->node,
 | 
				
			||||||
 | 
								xsurface->surface)->buffer->node;
 | 
				
			||||||
 | 
						wlr_scene_node_set_position(node, unmanaged->lx, unmanaged->ly);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue