[vlc-devel] commit: XCB: follow pointer motion in the parent window ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Oct 28 20:11:56 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Oct 28 21:03:11 2009 +0200| [3e046d808ca418068d40669844870fff6d505f74] | committer: Rémi Denis-Courmont 

XCB: follow pointer motion in the parent window

This ensures events are delivered when the mouse moves outside the
rendering area but within the embedding drawable. This is necessary to
autonatically unhide the cursor. As a side effect, we need to adjust
the pointer coordinates.

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

 modules/video_output/xcb/common.c |    3 ++-
 modules/video_output/xcb/events.c |    7 ++-----
 modules/video_output/xcb/x11.c    |    2 +-
 modules/video_output/xcb/xvideo.c |    2 +-
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/modules/video_output/xcb/common.c b/modules/video_output/xcb/common.c
index 80e6958..77ddd01 100644
--- a/modules/video_output/xcb/common.c
+++ b/modules/video_output/xcb/common.c
@@ -126,7 +126,8 @@ vout_window_t *GetWindow (vout_display_t *vd,
         free (geo);
 
         /* Subscribe to parent window resize events */
-        uint32_t value = XCB_EVENT_MASK_STRUCTURE_NOTIFY;
+        uint32_t value = XCB_EVENT_MASK_POINTER_MOTION
+                       | XCB_EVENT_MASK_STRUCTURE_NOTIFY;
         xcb_change_window_attributes (conn, wnd->handle.xid,
                                       XCB_CW_EVENT_MASK, &value);
         /* Try to subscribe to click events */
diff --git a/modules/video_output/xcb/events.c b/modules/video_output/xcb/events.c
index 87197e5..1542279 100644
--- a/modules/video_output/xcb/events.c
+++ b/modules/video_output/xcb/events.c
@@ -64,9 +64,9 @@ static void HandleMotionNotify (vout_display_t *vd,
         return;
 
     const int x = vd->source.i_x_offset +
-        (int64_t)(ev->event_x -0*place.x) * vd->source.i_visible_width / place.width;
+        (int64_t)(ev->event_x - place.x) * vd->source.i_visible_width / place.width;
     const int y = vd->source.i_y_offset +
-        (int64_t)(ev->event_y -0*place.y) * vd->source.i_visible_height/ place.height;
+        (int64_t)(ev->event_y - place.y) * vd->source.i_visible_height/ place.height;
 
     /* TODO show the cursor ? */
     if (x >= vd->source.i_x_offset && x < vd->source.i_x_offset + vd->source.i_visible_width &&
@@ -153,6 +153,3 @@ int ManageEvent (vout_display_t *vd, xcb_connection_t *conn, bool *visible)
 
     return VLC_SUCCESS;
 }
-
-
-
diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index 68e5214..116a396 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -257,7 +257,7 @@ static int Open (vlc_object_t *obj)
         const uint32_t values[] = {
             /* XCB_CW_EVENT_MASK */
             XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE |
-            XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_VISIBILITY_CHANGE,
+            XCB_EVENT_MASK_VISIBILITY_CHANGE,
             /* XCB_CW_COLORMAP */
             cmap,
         };
diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index d2cb1ca..316635f 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -447,7 +447,7 @@ static int Open (vlc_object_t *obj)
         const uint32_t mask =
             /* XCB_CW_EVENT_MASK */
             XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE |
-            XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_VISIBILITY_CHANGE;
+            XCB_EVENT_MASK_VISIBILITY_CHANGE;
         xcb_void_cookie_t c;
         xcb_window_t window = xcb_generate_id (conn);
 




More information about the vlc-devel mailing list