Commit b4190d91 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

XCB: remove display-level resize events

parent 5ddebbf9
......@@ -448,8 +448,7 @@ static int Open(vlc_object_t *obj)
return VLC_ENOMEM;
const xcb_screen_t *screen;
uint16_t width, height;
sys->embed = XCB_parent_Create(vd, &sys->conn, &screen, &width, &height);
sys->embed = XCB_parent_Create(vd, &sys->conn, &screen);
if (sys->embed == NULL)
{
free(sys);
......@@ -687,7 +686,6 @@ static int Open(vlc_object_t *obj)
if (is_fullscreen && vout_window_SetFullScreen(sys->embed, true))
is_fullscreen = false;
vout_display_SendEventFullscreen(vd, is_fullscreen);
vout_display_SendEventDisplaySize(vd, width, height);
return VLC_SUCCESS;
......
......@@ -85,8 +85,7 @@ static void RegisterEvents (vlc_object_t *obj, xcb_connection_t *conn,
xcb_window_t wnd)
{
/* Subscribe to parent window resize events */
uint32_t value = XCB_EVENT_MASK_POINTER_MOTION
| XCB_EVENT_MASK_STRUCTURE_NOTIFY;
uint32_t value = XCB_EVENT_MASK_POINTER_MOTION;
xcb_change_window_attributes (conn, wnd, XCB_CW_EVENT_MASK, &value);
/* Try to subscribe to click events */
/* (only one X11 client can get them, so might not work) */
......@@ -127,9 +126,7 @@ static const xcb_screen_t *FindScreen (vlc_object_t *obj,
*/
vout_window_t *XCB_parent_Create (vout_display_t *vd,
xcb_connection_t **restrict pconn,
const xcb_screen_t **restrict pscreen,
uint16_t *restrict pwidth,
uint16_t *restrict pheight)
const xcb_screen_t **restrict pscreen)
{
vout_window_cfg_t cfg = {
.type = VOUT_WINDOW_TYPE_XID,
......@@ -161,8 +158,6 @@ vout_window_t *XCB_parent_Create (vout_display_t *vd,
msg_Err (vd, "window not valid");
goto error;
}
*pwidth = geo->width;
*pheight = geo->height;
const xcb_screen_t *screen = FindScreen (VLC_OBJECT(vd), conn, geo->root);
free (geo);
......@@ -245,13 +240,6 @@ static void HandleVisibilityNotify (vout_display_t *vd, bool *visible,
msg_Dbg (vd, "display is %svisible", *visible ? "" : "not ");
}
static void
HandleParentStructure (vout_display_t *vd,
const xcb_configure_notify_event_t *ev)
{
vout_display_SendEventDisplaySize (vd, ev->width, ev->height);
}
/**
* Process an X11 event.
*/
......@@ -277,10 +265,6 @@ static int ProcessEvent (vout_display_t *vd, xcb_connection_t *conn,
(xcb_visibility_notify_event_t *)ev);
break;
case XCB_CONFIGURE_NOTIFY:
HandleParentStructure (vd, (xcb_configure_notify_event_t *)ev);
break;
/* FIXME I am not sure it is the right one */
case XCB_DESTROY_NOTIFY:
vout_display_SendEventClose (vd);
......
......@@ -38,8 +38,7 @@ int XCB_error_Check (vout_display_t *, xcb_connection_t *conn,
struct vout_window_t *XCB_parent_Create (vout_display_t *obj,
xcb_connection_t **,
const xcb_screen_t **,
uint16_t *width, uint16_t *height);
const xcb_screen_t **);
xcb_cursor_t XCB_cursor_Create (xcb_connection_t *, const xcb_screen_t *);
int XCB_Manage (vout_display_t *vd, xcb_connection_t *conn, bool *);
......@@ -90,10 +90,9 @@ static int Open (vlc_object_t *obj)
/* Get window, connect to X server (via XCB) */
xcb_connection_t *conn;
const xcb_screen_t *scr;
uint16_t width, height;
vout_window_t *surface;
surface = XCB_parent_Create (vd, &conn, &scr, &width, &height);
surface = XCB_parent_Create (vd, &conn, &scr);
if (surface == NULL)
{
free (sys);
......@@ -134,7 +133,6 @@ static int Open (vlc_object_t *obj)
if (vout_window_SetFullScreen (surface, fs))
fs = false;
vout_display_SendEventFullscreen (vd, fs);
vout_display_SendEventDisplaySize (vd, width, height);
return VLC_SUCCESS;
......
......@@ -115,8 +115,7 @@ static int Open (vlc_object_t *obj)
/* Get window, connect to X server */
xcb_connection_t *conn;
const xcb_screen_t *scr;
uint16_t width, height;
sys->embed = XCB_parent_Create (vd, &conn, &scr, &width, &height);
sys->embed = XCB_parent_Create (vd, &conn, &scr);
if (sys->embed == NULL)
{
free (sys);
......@@ -275,7 +274,8 @@ found_format:;
xcb_create_pixmap (conn, sys->depth, pixmap, scr->root, 1, 1);
c = xcb_create_window_checked (conn, sys->depth, sys->window,
sys->embed->handle.xid, 0, 0,
width, height, 0,
vd->cfg->display.width,
vd->cfg->display.height, 0,
XCB_WINDOW_CLASS_INPUT_OUTPUT,
vid, mask, values);
xcb_map_window (conn, sys->window);
......@@ -315,7 +315,6 @@ found_format:;
if (is_fullscreen && vout_window_SetFullScreen (sys->embed, true))
is_fullscreen = false;
vout_display_SendEventFullscreen (vd, is_fullscreen);
vout_display_SendEventDisplaySize (vd, width, height);
return VLC_SUCCESS;
......
......@@ -390,8 +390,7 @@ static int Open (vlc_object_t *obj)
/* Connect to X */
xcb_connection_t *conn;
const xcb_screen_t *screen;
uint16_t width, height;
p_sys->embed = XCB_parent_Create (vd, &conn, &screen, &width, &height);
p_sys->embed = XCB_parent_Create (vd, &conn, &screen);
if (p_sys->embed == NULL)
{
free (p_sys);
......@@ -594,7 +593,6 @@ static int Open (vlc_object_t *obj)
if (is_fullscreen && vout_window_SetFullScreen (p_sys->embed, true))
is_fullscreen = false;
vout_display_SendEventFullscreen (vd, is_fullscreen);
vout_display_SendEventDisplaySize (vd, width, height);
return VLC_SUCCESS;
......
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