mirror of
				https://github.com/labwc/labwc.git
				synced 2025-10-29 05:40:24 -04:00 
			
		
		
		
	xwayland: update stacking order in move_to_front/back()
Currently xwayland views are restacked on top of the XWayland server stacking order when activated (i.e. focused). This is wrong because focus/raise are independent concepts (though often occurring together). The stacking order should be updated when the view is raised/lowered, not when the view is focused. Work is in progress elsewhere (draft PR) that will result in views more often being raised without being focused. Without this fix, those views don't get restacked properly, resulting in clicks "passing through" to views underneath.
This commit is contained in:
		
							parent
							
								
									921c30c1fa
								
							
						
					
					
						commit
						0ddf3c43ad
					
				
					 1 changed files with 34 additions and 13 deletions
				
			
		|  | @ -635,6 +635,38 @@ xwayland_view_minimize(struct view *view, bool minimized) | |||
| 		minimized); | ||||
| } | ||||
| 
 | ||||
| static void | ||||
| xwayland_view_move_to_front(struct view *view) | ||||
| { | ||||
| 	view_impl_move_to_front(view); | ||||
| 	/*
 | ||||
| 	 * Update XWayland stacking order. | ||||
| 	 * | ||||
| 	 * FIXME: it would be better to restack above the next lower | ||||
| 	 * view, rather than on top of all other surfaces. Restacking | ||||
| 	 * the unmanaged surfaces afterward is ugly and still doesn't | ||||
| 	 * account for always-on-top views. | ||||
| 	 */ | ||||
| 	wlr_xwayland_surface_restack(xwayland_surface_from_view(view), | ||||
| 		NULL, XCB_STACK_MODE_ABOVE); | ||||
| 	/* Restack unmanaged surfaces on top */ | ||||
| 	struct wl_list *list = &view->server->unmanaged_surfaces; | ||||
| 	struct xwayland_unmanaged *u; | ||||
| 	wl_list_for_each(u, list, link) { | ||||
| 		wlr_xwayland_surface_restack(u->xwayland_surface, | ||||
| 			NULL, XCB_STACK_MODE_ABOVE); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| static void | ||||
| xwayland_view_move_to_back(struct view *view) | ||||
| { | ||||
| 	view_impl_move_to_back(view); | ||||
| 	/* Update XWayland stacking order */ | ||||
| 	wlr_xwayland_surface_restack(xwayland_surface_from_view(view), | ||||
| 		NULL, XCB_STACK_MODE_BELOW); | ||||
| } | ||||
| 
 | ||||
| static struct view * | ||||
| xwayland_view_get_root(struct view *view) | ||||
| { | ||||
|  | @ -697,17 +729,6 @@ xwayland_view_set_activated(struct view *view, bool activated) | |||
| 	} | ||||
| 
 | ||||
| 	wlr_xwayland_surface_activate(xwayland_surface, activated); | ||||
| 	if (activated) { | ||||
| 		wlr_xwayland_surface_restack(xwayland_surface, | ||||
| 			NULL, XCB_STACK_MODE_ABOVE); | ||||
| 		/* Restack unmanaged surfaces on top */ | ||||
| 		struct xwayland_unmanaged *u; | ||||
| 		struct wl_list *list = &view->server->unmanaged_surfaces; | ||||
| 		wl_list_for_each(u, list, link) { | ||||
| 			wlr_xwayland_surface_restack(u->xwayland_surface, | ||||
| 				NULL, XCB_STACK_MODE_ABOVE); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| static void | ||||
|  | @ -727,8 +748,8 @@ static const struct view_impl xwayland_view_impl = { | |||
| 	.unmap = xwayland_view_unmap, | ||||
| 	.maximize = xwayland_view_maximize, | ||||
| 	.minimize = xwayland_view_minimize, | ||||
| 	.move_to_front = view_impl_move_to_front, | ||||
| 	.move_to_back = view_impl_move_to_back, | ||||
| 	.move_to_front = xwayland_view_move_to_front, | ||||
| 	.move_to_back = xwayland_view_move_to_back, | ||||
| 	.get_root = xwayland_view_get_root, | ||||
| 	.append_children = xwayland_view_append_children, | ||||
| 	.is_related = xwayland_view_is_related, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 John Lindgren
						John Lindgren