(!1714) xwayland: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new window destructor hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									d4deaac6e1
								
							
						
					
					
						commit
						b3f592b481
					
				|  | @ -1134,8 +1134,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) | ||||||
|     xwl_screen->UnrealizeWindow = pScreen->UnrealizeWindow; |     xwl_screen->UnrealizeWindow = pScreen->UnrealizeWindow; | ||||||
|     pScreen->UnrealizeWindow = xwl_unrealize_window; |     pScreen->UnrealizeWindow = xwl_unrealize_window; | ||||||
| 
 | 
 | ||||||
|     xwl_screen->DestroyWindow = pScreen->DestroyWindow; |     dixScreenHookWindowDestroy(pScreen, xwl_window_destroy, NULL); | ||||||
|     pScreen->DestroyWindow = xwl_destroy_window; |  | ||||||
| 
 | 
 | ||||||
|     xwl_screen->CloseScreen = pScreen->CloseScreen; |     xwl_screen->CloseScreen = pScreen->CloseScreen; | ||||||
|     pScreen->CloseScreen = xwl_close_screen; |     pScreen->CloseScreen = xwl_close_screen; | ||||||
|  |  | ||||||
|  | @ -74,7 +74,6 @@ struct xwl_screen { | ||||||
|     ConfigNotifyProcPtr ConfigNotify; |     ConfigNotifyProcPtr ConfigNotify; | ||||||
|     RealizeWindowProcPtr RealizeWindow; |     RealizeWindowProcPtr RealizeWindow; | ||||||
|     UnrealizeWindowProcPtr UnrealizeWindow; |     UnrealizeWindowProcPtr UnrealizeWindow; | ||||||
|     DestroyWindowProcPtr DestroyWindow; |  | ||||||
|     XYToWindowProcPtr XYToWindow; |     XYToWindowProcPtr XYToWindow; | ||||||
|     SetWindowPixmapProcPtr SetWindowPixmap; |     SetWindowPixmapProcPtr SetWindowPixmap; | ||||||
|     ChangeWindowAttributesProcPtr ChangeWindowAttributes; |     ChangeWindowAttributesProcPtr ChangeWindowAttributes; | ||||||
|  |  | ||||||
|  | @ -1939,31 +1939,17 @@ xwl_window_create_frame_callback(struct xwl_window *xwl_window) | ||||||
|         xwl_present_for_each_frame_callback(xwl_window, xwl_present_reset_timer); |         xwl_present_for_each_frame_callback(xwl_window, xwl_present_reset_timer); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Bool | void | ||||||
| xwl_destroy_window(WindowPtr window) | xwl_window_destroy(ScreenPtr pScreen, WindowPtr window, void *arg) | ||||||
| { | { | ||||||
|     ScreenPtr screen = window->drawable.pScreen; |     struct xwl_screen *xwl_screen = xwl_screen_get(pScreen); | ||||||
|     struct xwl_screen *xwl_screen = xwl_screen_get(screen); |  | ||||||
|     struct xwl_window *xwl_window = xwl_window_get(window); |     struct xwl_window *xwl_window = xwl_window_get(window); | ||||||
|     Bool ret; |  | ||||||
| 
 | 
 | ||||||
|     if (xwl_screen->present) |     if (xwl_screen->present) | ||||||
|         xwl_present_cleanup(window); |         xwl_present_cleanup(window); | ||||||
| 
 | 
 | ||||||
|     if (xwl_window) |     if (xwl_window) | ||||||
|         xwl_window_dispose(xwl_window); |         xwl_window_dispose(xwl_window); | ||||||
| 
 |  | ||||||
|     screen->DestroyWindow = xwl_screen->DestroyWindow; |  | ||||||
| 
 |  | ||||||
|     if (screen->DestroyWindow) |  | ||||||
|         ret = screen->DestroyWindow (window); |  | ||||||
|     else |  | ||||||
|         ret = TRUE; |  | ||||||
| 
 |  | ||||||
|     xwl_screen->DestroyWindow = screen->DestroyWindow; |  | ||||||
|     screen->DestroyWindow = xwl_destroy_window; |  | ||||||
| 
 |  | ||||||
|     return ret; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static Bool | static Bool | ||||||
|  |  | ||||||
|  | @ -146,7 +146,7 @@ void xwl_move_window(WindowPtr window, | ||||||
|                      int x, int y, |                      int x, int y, | ||||||
|                      WindowPtr next_sib, |                      WindowPtr next_sib, | ||||||
|                      VTKind kind); |                      VTKind kind); | ||||||
| Bool xwl_destroy_window(WindowPtr window); | void xwl_window_destroy(ScreenPtr pScreen, WindowPtr window, void *arg); | ||||||
| void xwl_window_post_damage(struct xwl_window *xwl_window); | void xwl_window_post_damage(struct xwl_window *xwl_window); | ||||||
| void xwl_window_create_frame_callback(struct xwl_window *xwl_window); | void xwl_window_create_frame_callback(struct xwl_window *xwl_window); | ||||||
| void xwl_window_surface_do_destroy(struct xwl_wl_surface *xwl_wl_surface); | void xwl_window_surface_do_destroy(struct xwl_wl_surface *xwl_wl_surface); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue