From c14a8c6cc0fcd56c380d1220c2a8f04b74edee93 Mon Sep 17 00:00:00 2001 From: Jonas Ådahl Date: Tue, 13 Sep 2016 15:17:05 +0800 Subject: xwayland: Put getting a xwl_window from a Window in a helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonas Ådahl Reviewed-by: Peter Hutterer --- hw/xwayland/xwayland.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 46a2dfc41..ab7069c53 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -103,6 +103,12 @@ static DevPrivateKeyRec xwl_window_private_key; static DevPrivateKeyRec xwl_screen_private_key; static DevPrivateKeyRec xwl_pixmap_private_key; +static struct xwl_window * +xwl_window_get(WindowPtr window) +{ + return dixLookupPrivate(&window->devPrivates, &xwl_window_private_key); +} + struct xwl_screen * xwl_screen_get(ScreenPtr screen) { @@ -335,8 +341,7 @@ xwl_unrealize_window(WindowPtr window) xwl_screen->UnrealizeWindow = screen->UnrealizeWindow; screen->UnrealizeWindow = xwl_unrealize_window; - xwl_window = - dixLookupPrivate(&window->devPrivates, &xwl_window_private_key); + xwl_window = xwl_window_get(window); if (!xwl_window) return ret; -- cgit v1.2.3