From 82df2ce38c560915f8c6574052bd56215b649072 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Tue, 22 Aug 2017 15:38:26 +0200 Subject: xwayland: Avoid repeatedly looping through window ancestor chain Calling xwl_window_from_window means looping through the window ancestor chain whenever it is called on a child window or on an automatically redirected window. Since these properties and the potential ancestor's xwl_window are constant between window realization and unrealization, we can omit the looping by always putting the respective xwl_window in the Window's private field on its realization. If the Window doesn't feature an xwl_window on its own, it's the xwl_window of its first ancestor with one. Signed-off-by: Roman Gilg Reviewed-by: Pekka Paalanen --- hw/xwayland/xwayland.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/xwayland/xwayland.h') diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h index 6d3edf33b..3adee82fa 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -309,7 +309,7 @@ RRModePtr xwayland_cvt(int HDisplay, int VDisplay, void xwl_pixmap_set_private(PixmapPtr pixmap, struct xwl_pixmap *xwl_pixmap); struct xwl_pixmap *xwl_pixmap_get(PixmapPtr pixmap); -struct xwl_window *xwl_window_from_window(WindowPtr window); +struct xwl_window *xwl_window_of_top(WindowPtr window); Bool xwl_shm_create_screen_resources(ScreenPtr screen); PixmapPtr xwl_shm_create_pixmap(ScreenPtr screen, int width, int height, -- cgit v1.2.3