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