]> git.sesse.net Git - vlc/commitdiff
XCB: follow pointer motion in the parent window
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 28 Oct 2009 19:03:11 +0000 (21:03 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 28 Oct 2009 19:03:11 +0000 (21:03 +0200)
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.

modules/video_output/xcb/common.c
modules/video_output/xcb/events.c
modules/video_output/xcb/x11.c
modules/video_output/xcb/xvideo.c

index 80e69582fbf3ae020a38a8f2aa8f97b369cf8dc5..77ddd018f25297417eb594ef12780b5445908380 100644 (file)
@@ -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 */
index 87197e543d7008152f7b1d9ca2a2e9370aaeb966..154227911743657e1cc532d899a35b436fd3161a 100644 (file)
@@ -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;
 }
-
-
-
index 68e52149556ff8368fd3d75a75969b19f158eb93..116a3960fb17f0831d2dbc5beb425cec1a6bc723 100644 (file)
@@ -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,
         };
index d2cb1cad6055b3adaabe43a4a88885570e558c1f..316635fde5c74fd2a0f172a8d9c8d2039ae29cbc 100644 (file)
@@ -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);