mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	shells: Align geometry change commit handling
xdg_shell and xwayland handled geometry changes differently despite needing mostly identical behavior. The xwayland implementation has been changed to match that of xdg_shell.
This commit is contained in:
		
							parent
							
								
									90fa6953ea
								
							
						
					
					
						commit
						82b1019658
					
				
					 1 changed files with 21 additions and 24 deletions
				
			
		| 
						 | 
				
			
			@ -399,11 +399,6 @@ static void handle_commit(struct wl_listener *listener, void *data) {
 | 
			
		|||
	struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
 | 
			
		||||
	struct wlr_surface_state *state = &xsurface->surface->current;
 | 
			
		||||
 | 
			
		||||
	if (view->container->node.instruction) {
 | 
			
		||||
		get_geometry(view, &view->geometry);
 | 
			
		||||
		transaction_notify_view_ready_by_geometry(view,
 | 
			
		||||
				xsurface->x, xsurface->y, state->width, state->height);
 | 
			
		||||
	} else {
 | 
			
		||||
	struct wlr_box new_geo;
 | 
			
		||||
	get_geometry(view, &new_geo);
 | 
			
		||||
	bool new_size = new_geo.width != view->geometry.width ||
 | 
			
		||||
| 
						 | 
				
			
			@ -419,13 +414,15 @@ static void handle_commit(struct wl_listener *listener, void *data) {
 | 
			
		|||
		if (container_is_floating(view->container)) {
 | 
			
		||||
			view_update_size(view, new_geo.width, new_geo.height);
 | 
			
		||||
			transaction_commit_dirty();
 | 
			
		||||
				transaction_notify_view_ready_by_geometry(view,
 | 
			
		||||
					xsurface->x, xsurface->y, new_geo.width, new_geo.height);
 | 
			
		||||
		} else {
 | 
			
		||||
			view_center_surface(view);
 | 
			
		||||
		}
 | 
			
		||||
		desktop_damage_view(view);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (view->container->node.instruction) {
 | 
			
		||||
		transaction_notify_view_ready_by_geometry(view,
 | 
			
		||||
				xsurface->x, xsurface->y, state->width, state->height);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	view_damage_from(view);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue