Basicly same as mplayer/libvo/x11_common.c does.
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();
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 );
{
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" );
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 */
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") );
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 );