[vlc-devel] commit: XCB: no need to create a color map for default visual ( Rémi Denis-Courmont )

git version control git at videolan.org
Fri Apr 17 19:49:57 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Apr 17 20:44:35 2009 +0300| [185c88143f69d3f50ef5c181f61deeb8c7b5ca41] | committer: Rémi Denis-Courmont 

XCB: no need to create a color map for default visual

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=185c88143f69d3f50ef5c181f61deeb8c7b5ca41
---

 modules/video_output/xcb/x11.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index c794d33..155cae1 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -259,9 +259,14 @@ static int Open (vlc_object_t *obj)
              p_sys->bpp, p_sys->pad);
 
     /* Create colormap (needed to select non-default visual) */
-    p_sys->cmap = xcb_generate_id (p_sys->conn);
-    xcb_create_colormap (p_sys->conn, XCB_COLORMAP_ALLOC_NONE,
-                         p_sys->cmap, scr->root, p_sys->vid);
+    if (p_sys->vid != scr->root_visual)
+    {
+        p_sys->cmap = xcb_generate_id (p_sys->conn);
+        xcb_create_colormap (p_sys->conn, XCB_COLORMAP_ALLOC_NONE,
+                             p_sys->cmap, scr->root, p_sys->vid);
+    }
+    else
+        p_sys->cmap = scr->default_colormap;
 
     /* Check shared memory support */
     p_sys->shm = var_CreateGetBool (vout, "x11-shm") > 0;




More information about the vlc-devel mailing list