summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2016-09-13 15:17:05 +0800
committerAdam Jackson <ajax@redhat.com>2016-10-05 13:46:30 -0400
commitc14a8c6cc0fcd56c380d1220c2a8f04b74edee93 (patch)
treea1095733552f096383364d5d9713be84397e94dd
parentb4644ce8d3420447a8e5a2339238968da0a59de7 (diff)
xwayland: Put getting a xwl_window from a Window in a helper
Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--hw/xwayland/xwayland.c9
1 files 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;