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

xcb/glx: remove redundant pointer

parent 8baa3933
...@@ -58,7 +58,6 @@ vlc_module_end () ...@@ -58,7 +58,6 @@ vlc_module_end ()
struct vout_display_sys_t struct vout_display_sys_t
{ {
xcb_connection_t *conn; /**< XCB connection */ xcb_connection_t *conn; /**< XCB connection */
vout_window_t *embed; /* VLC window (when windowed) */
vlc_gl_t *gl; vlc_gl_t *gl;
xcb_cursor_t cursor; /* blank cursor */ xcb_cursor_t cursor; /* blank cursor */
...@@ -92,15 +91,17 @@ static int Open (vlc_object_t *obj) ...@@ -92,15 +91,17 @@ static int Open (vlc_object_t *obj)
xcb_connection_t *conn; xcb_connection_t *conn;
const xcb_screen_t *scr; const xcb_screen_t *scr;
uint16_t width, height; uint16_t width, height;
sys->embed = XCB_parent_Create (vd, &conn, &scr, &width, &height); vout_window_t *surface;
if (sys->embed == NULL)
surface = XCB_parent_Create (vd, &conn, &scr, &width, &height);
if (surface == NULL)
{ {
free (sys); free (sys);
return VLC_EGENERIC; return VLC_EGENERIC;
} }
sys->conn = conn; sys->conn = conn;
sys->gl = vlc_gl_Create (sys->embed, VLC_OPENGL, "glx"); sys->gl = vlc_gl_Create (surface, VLC_OPENGL, "glx");
if (sys->gl == NULL) if (sys->gl == NULL)
goto error; goto error;
...@@ -129,11 +130,11 @@ static int Open (vlc_object_t *obj) ...@@ -129,11 +130,11 @@ static int Open (vlc_object_t *obj)
vd->manage = Manage; vd->manage = Manage;
/* */ /* */
bool is_fullscreen = vd->cfg->is_fullscreen; bool fs = vd->cfg->is_fullscreen;
if (is_fullscreen && vout_window_SetFullScreen (sys->embed, true)) if (vout_window_SetFullScreen (surface, fs))
is_fullscreen = false; fs = false;
vout_display_SendEventFullscreen (vd, is_fullscreen); vout_display_SendEventFullscreen (vd, fs);
vout_display_SendEventDisplaySize (vd, width, height, is_fullscreen); vout_display_SendEventDisplaySize (vd, width, height, fs);
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -141,7 +142,7 @@ error: ...@@ -141,7 +142,7 @@ error:
if (sys->gl != NULL) if (sys->gl != NULL)
vlc_gl_Destroy (sys->gl); vlc_gl_Destroy (sys->gl);
xcb_disconnect (sys->conn); xcb_disconnect (sys->conn);
vout_display_DeleteWindow (vd, sys->embed); vout_display_DeleteWindow (vd, surface);
free (sys); free (sys);
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -154,19 +155,21 @@ static void Close (vlc_object_t *obj) ...@@ -154,19 +155,21 @@ static void Close (vlc_object_t *obj)
{ {
vout_display_t *vd = (vout_display_t *)obj; vout_display_t *vd = (vout_display_t *)obj;
vout_display_sys_t *sys = vd->sys; vout_display_sys_t *sys = vd->sys;
vlc_gl_t *gl = sys->gl;
vout_window_t *surface = gl->surface;
vlc_gl_MakeCurrent (sys->gl); vlc_gl_MakeCurrent (gl);
vout_display_opengl_Delete (sys->vgl); vout_display_opengl_Delete (sys->vgl);
vlc_gl_ReleaseCurrent (sys->gl); vlc_gl_ReleaseCurrent (gl);
vlc_gl_Destroy (sys->gl); vlc_gl_Destroy (gl);
/* show the default cursor */ /* show the default cursor */
xcb_change_window_attributes (sys->conn, sys->embed->handle.xid, xcb_change_window_attributes (sys->conn, surface->handle.xid,
XCB_CW_CURSOR, &(uint32_t) { XCB_CURSOR_NONE }); XCB_CW_CURSOR, &(uint32_t) { XCB_CURSOR_NONE });
xcb_flush (sys->conn); xcb_flush (sys->conn);
xcb_disconnect (sys->conn); xcb_disconnect (sys->conn);
vout_display_DeleteWindow (vd, sys->embed); vout_display_DeleteWindow (vd, surface);
free (sys); free (sys);
} }
...@@ -217,13 +220,13 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -217,13 +220,13 @@ static int Control (vout_display_t *vd, int query, va_list ap)
case VOUT_DISPLAY_CHANGE_FULLSCREEN: case VOUT_DISPLAY_CHANGE_FULLSCREEN:
{ {
const vout_display_cfg_t *c = va_arg (ap, const vout_display_cfg_t *); const vout_display_cfg_t *c = va_arg (ap, const vout_display_cfg_t *);
return vout_window_SetFullScreen (sys->embed, c->is_fullscreen); return vout_window_SetFullScreen (sys->gl->surface, c->is_fullscreen);
} }
case VOUT_DISPLAY_CHANGE_WINDOW_STATE: case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
{ {
unsigned state = va_arg (ap, unsigned); unsigned state = va_arg (ap, unsigned);
return vout_window_SetState (sys->embed, state); return vout_window_SetState (sys->gl->surface, state);
} }
case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
...@@ -250,7 +253,7 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -250,7 +253,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
/* */ /* */
if (query == VOUT_DISPLAY_CHANGE_DISPLAY_SIZE && va_arg (ap, int)) if (query == VOUT_DISPLAY_CHANGE_DISPLAY_SIZE && va_arg (ap, int))
{ {
vout_window_SetSize (sys->embed, vout_window_SetSize (sys->gl->surface,
cfg->display.width, cfg->display.height); cfg->display.width, cfg->display.height);
return VLC_EGENERIC; /* Always fail. See x11.c for rationale. */ return VLC_EGENERIC; /* Always fail. See x11.c for rationale. */
} }
...@@ -267,7 +270,7 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -267,7 +270,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
/* Hide the mouse. It will be send when /* Hide the mouse. It will be send when
* vout_display_t::info.b_hide_mouse is false */ * vout_display_t::info.b_hide_mouse is false */
case VOUT_DISPLAY_HIDE_MOUSE: case VOUT_DISPLAY_HIDE_MOUSE:
xcb_change_window_attributes (sys->conn, sys->embed->handle.xid, xcb_change_window_attributes (sys->conn, sys->gl->surface->handle.xid,
XCB_CW_CURSOR, &(uint32_t){ sys->cursor }); XCB_CW_CURSOR, &(uint32_t){ sys->cursor });
xcb_flush (sys->conn); xcb_flush (sys->conn);
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