[MPlayer-dev-eng] [PATCH] Xinerama full screen bug fix
Georgi Chorbadzhiyski
gf at unixsol.org
Wed Jul 23 00:52:54 CEST 2008
The following patch fixes a problem with full screen geometry when
mplayer is started with the X11 -xineramascreen option.
Without this patch the following produces wrong results:
1. Start mplayer -xineramascreen 1 file
2. Hit 'f' to put mplayer in full screen mode (or use -fs option)
- Everything works as expected
3. Hit 'f' again to stop full screen mode
4. Move mplayer window to another screen (with different resolution)
5. Hit 'f' to put mplayer into full screen mode again
- Expected - mplayer in full screen mode
- Result - mplayer in full screen mode but the video have
the dimensions of the first screen, not the current
screen
The problem is in libvo/x11_common.c: update_xinerama_info(void)
This function is used in two cases:
1. To position the mplayer window
2. To position full screen
The function auto detects current screen and acts accordingly
when no -xineramascreen option is used, but fails to detect current
screen when -xinramascreen is used.
The proposed fix is simple, allow vo_x11_fullscreen() to ignore
xinerama_screen option and always force auto detection in case when
full screen is requested.
Signed-off-by: Georgi Chorbadzhiyski <georgi at unixsol.org>
--- libvo/x11_common.c (revision 27338)
+++ libvo/x11_common.c (working copy)
@@ -366,8 +366,7 @@
XA_INIT(WM_DELETE_WINDOW);
}
-void update_xinerama_info(void) {
- int screen = xinerama_screen;
+void get_xinerama_info(int screen) {
xinerama_x = xinerama_y = 0;
#ifdef HAVE_XINERAMA
if (screen >= -1 && XineramaIsActive(mDisplay))
@@ -403,6 +402,10 @@
aspect_save_screenres(vo_screenwidth, vo_screenheight);
}
+void inline update_xinerama_info(void) {
+ get_xinerama_info(xinerama_screen);
+}
+
int vo_init(void)
{
// int mScreen;
@@ -1539,7 +1542,7 @@
vo_old_width = vo_dwidth;
vo_old_height = vo_dheight;
}
- update_xinerama_info();
+ get_xinerama_info(-1); // get current screen dimensions
x = xinerama_x;
y = xinerama_y;
w = vo_screenwidth;
--
Georgi Chorbadzhiyski
http://georgi.unixsol.org/
More information about the MPlayer-dev-eng
mailing list