Commit 34821277 authored by Thomas Guillem's avatar Thomas Guillem

vout: xcb: remove mouse cursor handling from displays

Ref #9787
parent a695036a
......@@ -60,7 +60,6 @@ struct vout_display_sys_t
picture_t *current; /**< Currently visible picture */
xcb_window_t window; /**< target window (owned by VDPAU back-end) */
xcb_cursor_t cursor; /**< blank cursor */
VdpDevice device; /**< VDPAU device handle */
VdpPresentationQueueTarget target; /**< VDPAU presentation queue target */
VdpPresentationQueue queue; /**< VDPAU presentation queue */
......@@ -329,9 +328,7 @@ static int Control(vout_display_t *vd, int query, va_list ap)
switch (query)
{
case VOUT_DISPLAY_HIDE_MOUSE:
xcb_change_window_attributes(sys->conn, sys->embed->handle.xid,
XCB_CW_CURSOR, &(uint32_t){ sys->cursor });
break;
return VLC_EGENERIC;
case VOUT_DISPLAY_RESET_PICTURES:
{
msg_Dbg(vd, "resetting pictures");
......@@ -648,7 +645,6 @@ static int Open(vlc_object_t *obj)
goto error;
}
sys->cursor = vlc_xcb_cursor_Create(sys->conn, screen);
sys->pool = NULL;
/* */
......@@ -678,9 +674,6 @@ static void Close(vlc_object_t *obj)
vout_display_t *vd = (vout_display_t *)obj;
vout_display_sys_t *sys = vd->sys;
/* Restore cursor explicitly (parent window connection will survive) */
xcb_change_window_attributes(sys->conn, sys->embed->handle.xid,
XCB_CW_CURSOR, &(uint32_t) { XCB_CURSOR_NONE });
xcb_flush(sys->conn);
vdp_presentation_queue_destroy(sys->vdp, sys->queue);
......
......@@ -142,17 +142,6 @@ error:
return NULL;
}
xcb_cursor_t vlc_xcb_cursor_Create(xcb_connection_t *conn,
const xcb_screen_t *scr)
{
xcb_cursor_t cur = xcb_generate_id (conn);
xcb_pixmap_t pix = xcb_generate_id (conn);
xcb_create_pixmap (conn, 1, pix, scr->root, 1, 1);
xcb_create_cursor (conn, cur, pix, pix, 0, 0, 0, 0, 0, 0, 1, 1);
return cur;
}
/* NOTE: we assume no other thread will be _setting_ our video output events
* variables. Afterall, only this plugin is supposed to know when these occur.
* Otherwise, we'd var_OrInteger() and var_NandInteger() functions...
......
......@@ -49,20 +49,6 @@ int vlc_xcb_error_Check(vout_display_t *, xcb_connection_t *conn,
struct vout_window_t *vlc_xcb_parent_Create(vout_display_t *obj,
xcb_connection_t **connp,
const xcb_screen_t **screenp);
/**
* Creates a blank cursor.
*
* \note Pixmaps are leaked until disconnection from the X server. Hence, this
* function should be called no more than once per X connection.
*
* @param conn XCB connection
* @param scr target XCB screen
* @return cursor XID
*/
xcb_cursor_t vlc_xcb_cursor_Create(xcb_connection_t *conn,
const xcb_screen_t *scr);
/**
* Processes XCB events.
*/
......
......@@ -66,7 +66,6 @@ struct vout_display_sys_t
xcb_connection_t *conn;
vout_window_t *embed; /* VLC window */
xcb_cursor_t cursor; /* blank cursor */
xcb_window_t window; /* drawable X window */
xcb_gcontext_t gc; /* context to put images */
xcb_shm_seg_t seg_base; /**< shared memory segment XID base */
......@@ -288,7 +287,6 @@ found_format:;
msg_Dbg (vd, "using X11 window %08"PRIx32, sys->window);
msg_Dbg (vd, "using X11 graphic context %08"PRIx32, sys->gc);
sys->cursor = vlc_xcb_cursor_Create(conn, scr);
sys->visible = false;
if (XCB_shm_Check (obj, conn))
{
......@@ -327,9 +325,6 @@ static void Close (vlc_object_t *obj)
ResetPictures (vd);
/* show the default cursor */
xcb_change_window_attributes (sys->conn, sys->embed->handle.xid, XCB_CW_CURSOR,
&(uint32_t) { XCB_CURSOR_NONE });
xcb_flush (sys->conn);
/* colormap, window and context are garbage-collected by X */
......@@ -511,13 +506,8 @@ static int Control (vout_display_t *vd, int query, va_list ap)
return VLC_SUCCESS;
}
/* 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 (sys->conn, sys->embed->handle.xid,
XCB_CW_CURSOR, &(uint32_t){ sys->cursor });
xcb_flush (sys->conn);
return VLC_SUCCESS;
return VLC_EGENERIC;
default:
msg_Err (vd, "Unknown request in XCB vout display");
......
......@@ -82,7 +82,6 @@ struct vout_display_sys_t
xcb_connection_t *conn;
vout_window_t *embed;/* VLC window */
xcb_cursor_t cursor; /* blank cursor */
xcb_window_t window; /* drawable X window */
xcb_gcontext_t gc; /* context to put images */
xcb_xv_port_t port; /* XVideo port */
......@@ -549,9 +548,6 @@ static int Open (vlc_object_t *obj)
free(r);
}
/* Create cursor */
p_sys->cursor = vlc_xcb_cursor_Create(conn, screen);
p_sys->shm = XCB_shm_Check (obj, conn);
p_sys->visible = false;
......@@ -592,9 +588,6 @@ static void Close (vlc_object_t *obj)
if (p_sys->pool)
picture_pool_Release (p_sys->pool);
/* show the default cursor */
xcb_change_window_attributes (p_sys->conn, p_sys->embed->handle.xid, XCB_CW_CURSOR,
&(uint32_t) { XCB_CURSOR_NONE });
xcb_flush (p_sys->conn);
free (p_sys->att);
......@@ -762,13 +755,8 @@ static int Control (vout_display_t *vd, int query, va_list ap)
return VLC_SUCCESS;
}
/* 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 (p_sys->conn, p_sys->embed->handle.xid,
XCB_CW_CURSOR, &(uint32_t){ p_sys->cursor });
xcb_flush (p_sys->conn);
return VLC_SUCCESS;
return VLC_EGENERIC;
case VOUT_DISPLAY_RESET_PICTURES:
vlc_assert_unreachable();
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment