xserver: Branch 'xwayland' - 2 commits

Kristian Høgsberg krh at kemper.freedesktop.org
Mon Sep 16 12:14:57 PDT 2013


 hw/xfree86/xwayland/xwayland-cursor.c  |   15 +++++++++------
 hw/xfree86/xwayland/xwayland-private.h |    2 ++
 hw/xfree86/xwayland/xwayland-window.c  |    3 ---
 3 files changed, 11 insertions(+), 9 deletions(-)

New commits:
commit 75257995bf2837235de15ac3f04f022509d13f6b
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Mon Sep 16 12:05:19 2013 -0700

    xwayland: Use a per-screen private key for cursor privates
    
    The cursor is a per-display object, so we need to set private data on it
    using a per-screen private key to avoid stepping on privates from other
    screens.

diff --git a/hw/xfree86/xwayland/xwayland-cursor.c b/hw/xfree86/xwayland/xwayland-cursor.c
index 1cd6457..2cdd248 100644
--- a/hw/xfree86/xwayland/xwayland-cursor.c
+++ b/hw/xfree86/xwayland/xwayland-cursor.c
@@ -40,8 +40,6 @@
 #include "xwayland-private.h"
 #include "xserver-client-protocol.h"
 
-static DevPrivateKeyRec xwl_cursor_private_key;
-
 static void
 expand_source_and_mask(CursorPtr cursor, void *data)
 {
@@ -129,7 +127,8 @@ xwl_realize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor)
 				  WL_SHM_FORMAT_ARGB8888);
     wl_shm_pool_destroy(pool);
 
-    dixSetPrivate(&cursor->devPrivates, &xwl_cursor_private_key, buffer);
+    dixSetPrivate(&cursor->devPrivates,
+                  &xwl_screen->cursor_private_key, buffer);
 
     return TRUE;
 }
@@ -139,8 +138,11 @@ xwl_unrealize_cursor(DeviceIntPtr device,
 			ScreenPtr screen, CursorPtr cursor)
 {
     struct wl_buffer *buffer;
+    struct xwl_screen *xwl_screen;
 
-    buffer = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key);
+    xwl_screen = xwl_screen_get(screen);
+    buffer = dixGetPrivate(&cursor->devPrivates,
+                           &xwl_screen->cursor_private_key);
     wl_buffer_destroy(buffer);
 
     return TRUE;
@@ -155,7 +157,7 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat)
         return;
 
     buffer = dixGetPrivate(&xwl_seat->x_cursor->devPrivates,
-                           &xwl_cursor_private_key);
+                           &xwl_seat->xwl_screen->cursor_private_key);
 
     wl_pointer_set_cursor(xwl_seat->wl_pointer,
 			  xwl_seat->pointer_enter_serial,
@@ -229,7 +231,8 @@ xwl_screen_init_cursor(struct xwl_screen *xwl_screen, ScreenPtr screen)
 {
     miPointerScreenPtr pointer_priv;
 
-    if (!dixRegisterPrivateKey(&xwl_cursor_private_key, PRIVATE_CURSOR, 0))
+    if (!dixRegisterPrivateKey(&xwl_screen->cursor_private_key,
+                               PRIVATE_CURSOR, 0))
 	return BadAlloc;
 
     pointer_priv = dixLookupPrivate(&screen->devPrivates, miPointerScreenKey);
diff --git a/hw/xfree86/xwayland/xwayland-private.h b/hw/xfree86/xwayland/xwayland-private.h
index b0b2201..aa9fc03 100644
--- a/hw/xfree86/xwayland/xwayland-private.h
+++ b/hw/xfree86/xwayland/xwayland-private.h
@@ -65,6 +65,8 @@ struct xwl_screen {
     uint32_t			 serial;
     Bool                         outputs_initialized;
 
+    DevPrivateKeyRec             cursor_private_key;
+
     CreateWindowProcPtr		 CreateWindow;
     DestroyWindowProcPtr	 DestroyWindow;
     RealizeWindowProcPtr	 RealizeWindow;
commit 5683b69798dd6bcb7bb6ddc18a51bd8b2878457a
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Mon Sep 16 11:51:57 2013 -0700

    xwayland: Remove unused variables

diff --git a/hw/xfree86/xwayland/xwayland-window.c b/hw/xfree86/xwayland/xwayland-window.c
index 88f57ce..20db80c 100644
--- a/hw/xfree86/xwayland/xwayland-window.c
+++ b/hw/xfree86/xwayland/xwayland-window.c
@@ -92,9 +92,6 @@ xwl_create_window(WindowPtr window)
 {
     ScreenPtr screen = window->drawable.pScreen;
     struct xwl_screen *xwl_screen;
-    char buffer[32];
-    int len, rc;
-    Atom name;
     Bool ret;
 
     xwl_screen = xwl_screen_get(screen);


More information about the xorg-commit mailing list