xwayland: Only ignore manual redirection by clients for surface window
If the manual redirection was done by xwl_present_maybe_redirect_window, we are in control. This allows xwl_present_maybe_redirect_window to work as intended again. Previously, xwl_window_update_surface_window would ignore the window redirected by xwl_present_maybe_redirect_window, which would result in xwl_present_maybe_redirect_window undoing the redirection and bailing. Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1570>
This commit is contained in:
		
							parent
							
								
									ed575eee81
								
							
						
					
					
						commit
						e1b8a12194
					
				|  | @ -1297,9 +1297,12 @@ xwl_present_maybe_redirect_window(WindowPtr window) | |||
|         return FALSE; | ||||
|     } | ||||
| 
 | ||||
|     xwl_present_window->redirected = TRUE; | ||||
| 
 | ||||
|     xwl_window_update_surface_window(xwl_window); | ||||
|     if (xwl_window->surface_window != window) { | ||||
|         compUnredirectWindow(serverClient, window, CompositeRedirectManual); | ||||
|         xwl_present_window->redirected = FALSE; | ||||
|         xwl_present_window->redirect_failed = TRUE; | ||||
|         return FALSE; | ||||
|     } | ||||
|  | @ -1307,7 +1310,6 @@ xwl_present_maybe_redirect_window(WindowPtr window) | |||
|     if (!xwl_window->surface_window_damage) | ||||
|         xwl_window->surface_window_damage = RegionCreate(NullBox, 1); | ||||
| 
 | ||||
|     xwl_present_window->redirected = TRUE; | ||||
|     return TRUE; | ||||
| } | ||||
| 
 | ||||
|  | @ -1344,6 +1346,14 @@ xwl_present_maybe_unredirect_window(WindowPtr window) | |||
|     return TRUE; | ||||
| } | ||||
| 
 | ||||
| Bool | ||||
| xwl_present_window_redirected(WindowPtr window) | ||||
| { | ||||
|     struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv(window); | ||||
| 
 | ||||
|     return xwl_present_window->redirected; | ||||
| } | ||||
| 
 | ||||
| Bool | ||||
| xwl_present_init(ScreenPtr screen) | ||||
| { | ||||
|  |  | |||
|  | @ -83,5 +83,6 @@ void xwl_present_cleanup(WindowPtr window); | |||
| void xwl_present_unrealize_window(struct xwl_present_window *xwl_present_window); | ||||
| Bool xwl_present_maybe_redirect_window(WindowPtr window); | ||||
| Bool xwl_present_maybe_unredirect_window(WindowPtr window); | ||||
| Bool xwl_present_window_redirected(WindowPtr window); | ||||
| 
 | ||||
| #endif /* XWAYLAND_PRESENT_H */ | ||||
|  |  | |||
|  | @ -1370,7 +1370,8 @@ xwl_window_update_surface_window(struct xwl_window *xwl_window) | |||
|         if (window->drawable.depth == 32) | ||||
|             continue; | ||||
| 
 | ||||
|         if (window->redirectDraw == RedirectDrawManual) | ||||
|         if (window->redirectDraw == RedirectDrawManual && | ||||
|             !xwl_present_window_redirected(window)) | ||||
|             break; | ||||
| 
 | ||||
|         surface_window = window; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue