mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	rootston: fix damage tracking for fullscreen xwayland views
This commit is contained in:
		
							parent
							
								
									66ae4071a7
								
							
						
					
					
						commit
						f704c3d42b
					
				
					 2 changed files with 29 additions and 5 deletions
				
			
		| 
						 | 
					@ -121,8 +121,10 @@ static void view_for_each_surface(struct roots_view *view,
 | 
				
			||||||
			view->y, view->rotation, false, iterator, user_data);
 | 
								view->y, view->rotation, false, iterator, user_data);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case ROOTS_XWAYLAND_VIEW:
 | 
						case ROOTS_XWAYLAND_VIEW:
 | 
				
			||||||
 | 
							if (view->wlr_surface != NULL) {
 | 
				
			||||||
			surface_for_each_surface(view->wlr_surface, view->x, view->y,
 | 
								surface_for_each_surface(view->wlr_surface, view->x, view->y,
 | 
				
			||||||
				view->rotation, iterator, user_data);
 | 
									view->rotation, iterator, user_data);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -466,6 +468,28 @@ static void output_damage_whole(struct roots_output *output) {
 | 
				
			||||||
	schedule_render(output);
 | 
						schedule_render(output);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static bool view_accept_damage(struct roots_output *output,
 | 
				
			||||||
 | 
							struct roots_view *view) {
 | 
				
			||||||
 | 
						if (output->fullscreen_view == NULL) {
 | 
				
			||||||
 | 
							return true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if (output->fullscreen_view == view) {
 | 
				
			||||||
 | 
							return true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if (output->fullscreen_view->type == ROOTS_XWAYLAND_VIEW &&
 | 
				
			||||||
 | 
								view->type == ROOTS_XWAYLAND_VIEW) {
 | 
				
			||||||
 | 
							// Special case: accept damage from children
 | 
				
			||||||
 | 
							struct wlr_xwayland_surface *xsurface = view->xwayland_surface;
 | 
				
			||||||
 | 
							while (xsurface != NULL) {
 | 
				
			||||||
 | 
								if (output->fullscreen_view->xwayland_surface == xsurface) {
 | 
				
			||||||
 | 
									return true;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								xsurface = xsurface->parent;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return false;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void damage_whole_surface(struct wlr_surface *surface,
 | 
					static void damage_whole_surface(struct wlr_surface *surface,
 | 
				
			||||||
		double lx, double ly, float rotation, void *data) {
 | 
							double lx, double ly, float rotation, void *data) {
 | 
				
			||||||
	struct roots_output *output = data;
 | 
						struct roots_output *output = data;
 | 
				
			||||||
| 
						 | 
					@ -489,7 +513,7 @@ static void damage_whole_surface(struct wlr_surface *surface,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void output_damage_whole_view(struct roots_output *output,
 | 
					void output_damage_whole_view(struct roots_output *output,
 | 
				
			||||||
		struct roots_view *view) {
 | 
							struct roots_view *view) {
 | 
				
			||||||
	if (output->fullscreen_view != NULL && output->fullscreen_view != view) {
 | 
						if (!view_accept_damage(output, view)) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -524,7 +548,7 @@ static void damage_from_surface(struct wlr_surface *surface,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void output_damage_from_view(struct roots_output *output,
 | 
					void output_damage_from_view(struct roots_output *output,
 | 
				
			||||||
		struct roots_view *view) {
 | 
							struct roots_view *view) {
 | 
				
			||||||
	if (output->fullscreen_view != NULL && output->fullscreen_view != view) {
 | 
						if (!view_accept_damage(output, view)) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -315,7 +315,7 @@ static void read_surface_parent(struct wlr_xwm *xwm,
 | 
				
			||||||
		wl_list_init(&xsurface->parent_link);
 | 
							wl_list_init(&xsurface->parent_link);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wlr_log(L_DEBUG, "XCB_ATOM_WM_TRANSIENT_FOR: %p", xid);
 | 
						wlr_log(L_DEBUG, "XCB_ATOM_WM_TRANSIENT_FOR: %p", xsurface->parent);
 | 
				
			||||||
	wl_signal_emit(&xsurface->events.set_parent, xsurface);
 | 
						wl_signal_emit(&xsurface->events.set_parent, xsurface);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue