[vlc-commits] XCB: flush when changing the cursor

Rémi Denis-Courmont git at videolan.org
Sun May 29 19:21:34 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May 29 20:21:01 2011 +0300| [5e66bde2b006d572db85b7ffec3ba589f2bc933e] | committer: Rémi Denis-Courmont

XCB: flush when changing the cursor

This should fix cursor (un)hiding with some OpenGL back-ends

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

 modules/video_output/xcb/events.c |    1 +
 modules/video_output/xcb/glx.c    |    8 ++++++--
 modules/video_output/xcb/x11.c    |    1 +
 modules/video_output/xcb/xvideo.c |    1 +
 4 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/xcb/events.c b/modules/video_output/xcb/events.c
index e09c0cc..e68a35e 100644
--- a/modules/video_output/xcb/events.c
+++ b/modules/video_output/xcb/events.c
@@ -135,6 +135,7 @@ static void HandleMotionNotify (vout_display_t *vd, xcb_connection_t *conn,
     /* show the default cursor */
     xcb_change_window_attributes (conn, ev->event, XCB_CW_CURSOR,
                                   &(uint32_t) { XCB_CURSOR_NONE });
+    xcb_flush (conn);
 
     /* TODO it could be saved */
     vout_display_PlacePicture (&place, &vd->source, vd->cfg, false);
diff --git a/modules/video_output/xcb/glx.c b/modules/video_output/xcb/glx.c
index d2861ea..6d61b1e 100644
--- a/modules/video_output/xcb/glx.c
+++ b/modules/video_output/xcb/glx.c
@@ -553,10 +553,14 @@ static int Control (vout_display_t *vd, int query, va_list ap)
     /* Hide the mouse. It will be send when
      * vout_display_t::info.b_hide_mouse is false */
     case VOUT_DISPLAY_HIDE_MOUSE:
-        xcb_change_window_attributes (XGetXCBConnection (sys->display),
-                                      sys->embed->handle.xid,
+    {
+        xcb_connection_t *conn = XGetXCBConnection (sys->display);
+
+        xcb_change_window_attributes (conn, sys->embed->handle.xid,
                                     XCB_CW_CURSOR, &(uint32_t){ sys->cursor });
+        xcb_flush (conn);
         return VLC_SUCCESS;
+    }
 
     case VOUT_DISPLAY_GET_OPENGL:
     {
diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index 48dd7aa..13758ea 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -535,6 +535,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
     case VOUT_DISPLAY_HIDE_MOUSE:
         xcb_change_window_attributes (sys->conn, sys->embed->handle.xid,
                                   XCB_CW_CURSOR, &(uint32_t){ sys->cursor });
+        xcb_flush (sys->conn);
         return VLC_SUCCESS;
 
     default:
diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index 7d0041b..b7e0339 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -797,6 +797,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
     case VOUT_DISPLAY_HIDE_MOUSE:
         xcb_change_window_attributes (p_sys->conn, p_sys->embed->handle.xid,
                                   XCB_CW_CURSOR, &(uint32_t){ p_sys->cursor });
+        xcb_flush (p_sys->conn);
         return VLC_SUCCESS;
     case VOUT_DISPLAY_RESET_PICTURES:
         assert(0);



More information about the vlc-commits mailing list