Commit a0a1a207 authored by Ilkka Ollakka's avatar Ilkka Ollakka

Calculate position for videowindow to use current screen in xinerama-setup also.

Basicly same as mplayer/libvo/x11_common.c does.
parent 70c75214
......@@ -130,7 +130,7 @@ vlc_module_begin();
add_bool( "glx-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT, true );
#endif
#ifdef HAVE_XINERAMA
add_integer ( "glx-xineramascreen", 0, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, true );
add_integer ( "glx-xineramascreen", -1, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, true );
#endif
vlc_module_end();
......
......@@ -76,7 +76,7 @@ vlc_module_begin();
add_bool( "x11-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT, true );
#endif
#ifdef HAVE_XINERAMA
add_integer ( "x11-xineramascreen", 0, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, true );
add_integer ( "x11-xineramascreen", -1, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, true );
#endif
set_description( N_("X11 video output") );
set_capability( "video output", 70 );
......
......@@ -2094,6 +2094,39 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
{
msg_Dbg( p_vout, "entering fullscreen mode" );
/* Getting current window position */
Window root_win;
Window* child_windows;
int num_child_windows;
Window parent_win;
Window child_win;
XWindowAttributes win_attr;
int screen_x,screen_y;
XGetWindowAttributes(
p_vout->p_sys->p_display,
p_vout->p_sys->p_win->video_window,
&win_attr);
XQueryTree(
p_vout->p_sys->p_display,
p_vout->p_sys->p_win->video_window,
&root_win,
&parent_win,
&child_windows,
&num_child_windows);
XFree(child_windows);
XTranslateCoordinates(
p_vout->p_sys->p_display,
parent_win, win_attr.root,
win_attr.x,win_attr.y,
&screen_x,&screen_y,
&child_win);
msg_Dbg( p_vout, "X %d/%d Y %d/%d", win_attr.x,screen_x,win_attr.y,screen_y);
/* screen_x and screen_y are current position */
p_vout->p_sys->b_altfullscreen =
config_GetInt( p_vout, MODULE_STRING "-altfullscreen" );
......@@ -2190,11 +2223,26 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
SCREEN = config_GetInt( p_vout,
MODULE_STRING "-xineramascreen" );
/* just check that user has entered a good value */
/* just check that user has entered a good value,
* otherwise use that screen where window is */
if( SCREEN >= i_num_screens || SCREEN < 0 )
{
msg_Dbg( p_vout, "requested screen number invalid (%d/%d)", SCREEN, i_num_screens );
SCREEN = 0;
#define left screens[SCREEN].x_org
#define right left + screens[SCREEN].width
#define top screens[SCREEN].y_org
#define bottom top + screens[SCREEN].height
for( SCREEN = i_num_screens-1; SCREEN > 0; SCREEN--)
{
if( left <= screen_x && screen_x <= right &&
top <= screen_y && screen_y <= bottom )
break;
}
#undef bottom
#undef top
#undef right
#undef left
}
/* Get the X/Y upper left corner coordinate of the above screen */
......
......@@ -89,7 +89,7 @@ vlc_module_begin();
add_bool( "xvideo-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT, true );
#endif
#ifdef HAVE_XINERAMA
add_integer ( "xvideo-xineramascreen", 0, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, true );
add_integer ( "xvideo-xineramascreen", -1, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, true );
#endif
set_description( N_("XVideo extension video output") );
......
......@@ -143,7 +143,7 @@ vlc_module_begin();
add_bool( "xvmc-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT, true );
#endif
#ifdef HAVE_XINERAMA
add_integer ( "xvmc-xineramascreen", 0, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, true );
add_integer ( "xvmc-xineramascreen", -1, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, true );
#endif
add_string( "xvmc-deinterlace-mode", "bob", NULL, MODE_TEXT, MODE_LONGTEXT, false );
add_string( "xvmc-crop-style", "eq", NULL, CROP_TEXT, CROP_LONGTEXT, false );
......
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