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

Use --x11-display whenever calling XOpenDisplay (except Qt4 this far)

parent edf32d6b
...@@ -41,11 +41,13 @@ int screen_InitCapture( demux_t *p_demux ) ...@@ -41,11 +41,13 @@ int screen_InitCapture( demux_t *p_demux )
{ {
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
Display *p_display; Display *p_display;
char *psz_display = var_CreateGetNonEmptyString( p_demux, "x11-display" );
XWindowAttributes win_info; XWindowAttributes win_info;
int i_chroma; int i_chroma;
/* Open the display */ /* Open the display */
p_display = XOpenDisplay( NULL ); p_display = XOpenDisplay( psz_display );
free( psz_display );
if( !p_display ) if( !p_display )
{ {
msg_Err( p_demux, "cannot open display" ); msg_Err( p_demux, "cannot open display" );
......
...@@ -81,8 +81,10 @@ static int Open( vlc_object_t *p_this ) ...@@ -81,8 +81,10 @@ static int Open( vlc_object_t *p_this )
{ {
intf_thread_t *p_intf = (intf_thread_t *)p_this; intf_thread_t *p_intf = (intf_thread_t *)p_this;
intf_sys_t *p_sys; intf_sys_t *p_sys;
char *psz_display = var_CreateGetNonEmptyString( p_intf, "x11-display" );
Display *p_display = XOpenDisplay( NULL ); Display *p_display = XOpenDisplay( psz_display );
free( psz_display );
if( !p_display ) if( !p_display )
return VLC_EGENERIC; return VLC_EGENERIC;
XSetErrorHandler( X11ErrorHandler ); XSetErrorHandler( X11ErrorHandler );
......
...@@ -53,8 +53,10 @@ ...@@ -53,8 +53,10 @@
X11Display::X11Display( intf_thread_t *pIntf ): SkinObject( pIntf ), X11Display::X11Display( intf_thread_t *pIntf ): SkinObject( pIntf ),
m_mainWindow( 0 ), m_gc( NULL ), m_colormap( 0 ) m_mainWindow( 0 ), m_gc( NULL ), m_colormap( 0 )
{ {
char *psz_display = var_CreateGetNonEmptyString( pIntf, "x11-display" );
// Open a connection to the X Server // Open a connection to the X Server
m_pDisplay = XOpenDisplay( NULL ); m_pDisplay = XOpenDisplay( psz_display );
free( psz_display );
if( m_pDisplay == NULL ) if( m_pDisplay == NULL )
{ {
......
...@@ -558,7 +558,10 @@ static int AdjustHeight( vout_thread_t *p_vout ) ...@@ -558,7 +558,10 @@ static int AdjustHeight( vout_thread_t *p_vout )
i_window_width = GetSystemMetrics(SM_CXSCREEN); i_window_width = GetSystemMetrics(SM_CXSCREEN);
i_window_height = GetSystemMetrics(SM_CYSCREEN); i_window_height = GetSystemMetrics(SM_CYSCREEN);
#else #else
Display *p_display = XOpenDisplay( "" ); char *psz_display = var_CreateGetNonEmptyString( p_vout,
"x11-display" );
Display *p_display = XOpenDisplay( psz_display );
free( psz_display );
if (p_vout->p_sys->b_xinerama) if (p_vout->p_sys->b_xinerama)
{ {
i_window_width = DisplayWidth(p_display, 0) / p_vout->p_sys->i_col; i_window_width = DisplayWidth(p_display, 0) / p_vout->p_sys->i_col;
......
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