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

- Use VidMode extension to determine the display dimensions more accurately...

- Use VidMode extension to determine the display dimensions more accurately when enabling full screen mode (fixes #534, should fix Debian #290392)
- Move view port and cursor to a sane position
- Check for VidMode extensions (libXxf86vm)
parent 651614ce
...@@ -3389,12 +3389,12 @@ if test "${enable_glx}" != "no" && ...@@ -3389,12 +3389,12 @@ if test "${enable_glx}" != "no" &&
CPPFLAGS="${CPPFLAGS_save}" CPPFLAGS="${CPPFLAGS_save}"
fi fi
dnl
dnl Check for the Xinerama extension
dnl
if test "${enable_xvideo}" != "no" && if test "${enable_xvideo}" != "no" &&
(test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" || (test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ||
test "${enable_xvideo}" = "yes"); then test "${enable_xvideo}" = "yes"); then
dnl
dnl Check for the Xinerama extension
dnl
ac_cv_have_xinerama="no" ac_cv_have_xinerama="no"
CPPFLAGS="${CPPFLAGS_save} ${X_CFLAGS}" CPPFLAGS="${CPPFLAGS_save} ${X_CFLAGS}"
CFLAGS="${CFLAGS_save} ${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext" CFLAGS="${CFLAGS_save} ${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext"
...@@ -3418,6 +3418,38 @@ if test "${enable_xvideo}" != "no" && ...@@ -3418,6 +3418,38 @@ if test "${enable_xvideo}" != "no" &&
fi fi
CFLAGS="${CFLAGS_save}" CFLAGS="${CFLAGS_save}"
CPPFLAGS="${CPPFLAGS_save}" CPPFLAGS="${CPPFLAGS_save}"
dnl
dnl Check for XF86VidMode extension
dnl
ac_cv_have_xf86vidmode="no"
CPPFLAGS="${CPPFLAGS_save} ${X_CFLAGS}"
CFLAGS="${CFLAGS_save} ${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext"
AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,[
AC_CHECK_LIB(Xxf86vm_pic, XF86VidModeGetViewPort,[
VLC_ADD_LDFLAGS([xvideo],[-lXxf86vm_pic])
VLC_ADD_LDFLAGS([x11],[-lXxf86vm_pic])
VLC_ADD_LDFLAGS([glx],[-lXxf86vm_pic])
ac_cv_have_xf86vidmode="yes"
],[
AC_CHECK_LIB(Xxf86vm, XF86VidModeGetViewPort,[
VLC_ADD_LDFLAGS([xvideo],[-lXxf86vm])
VLC_ADD_LDFLAGS([x11],[-lXxf86vm])
VLC_ADD_LDFLAGS([glx],[-lXxf86vm])
ac_cv_have_xf86vidmode="yes"
])
])
],[true],
[#ifdef HAVE_X11_XLIB_H
# include <X11/Xlib.h>
#endif]
)
AS_IF([test "${ac_cv_have_xf86vidmode}" = "yes"],
[AC_DEFINE(HAVE_XF86VIDMODE, 1, [Define this if you have libXxf86vm installed])
])
CFLAGS="${CFLAGS_save}"
CPPFLAGS="${CPPFLAGS_save}"
fi fi
dnl dnl
......
/***************************************************************************** /*****************************************************************************
* xcommon.c: Functions common to the X11 and XVideo plugins * xcommon.c: Functions common to the X11 and XVideo plugins
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 the VideoLAN team * Copyright (C) 1998-2006 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
...@@ -76,6 +76,10 @@ ...@@ -76,6 +76,10 @@
# include <X11/extensions/Xinerama.h> # include <X11/extensions/Xinerama.h>
#endif #endif
#ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
# include <X11/extensions/xf86vmode.h>
#endif
#include "xcommon.h" #include "xcommon.h"
/***************************************************************************** /*****************************************************************************
...@@ -1568,6 +1572,31 @@ static void ToggleFullScreen ( vout_thread_t *p_vout ) ...@@ -1568,6 +1572,31 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
{ {
/* The window wasn't necessarily created at the requested size */ /* The window wasn't necessarily created at the requested size */
p_vout->p_sys->p_win->i_x = p_vout->p_sys->p_win->i_y = 0; p_vout->p_sys->p_win->i_x = p_vout->p_sys->p_win->i_y = 0;
#ifdef HAVE_XF86VIDMODE
XF86VidModeModeLine mode;
int i_dummy;
if( XF86VidModeGetModeLine( p_vout->p_sys->p_display,
p_vout->p_sys->i_screen, &i_dummy,
&mode ) )
{
p_vout->p_sys->p_win->i_width = mode.hdisplay;
p_vout->p_sys->p_win->i_height = mode.vdisplay;
/* move cursor to the middle of the window to prevent
* unwanted display move if the display is smaller than the
* full desktop */
XWarpPointer( p_vout->p_sys->p_display, None,
p_vout->p_sys->p_win->base_window, 0, 0, 0, 0,
mode.hdisplay / 2 , mode.vdisplay / 2 );
/* force desktop view to upper left corner */
XF86VidModeSetViewPort( p_vout->p_sys->p_display,
p_vout->p_sys->i_screen, 0, 0 );
}
else
#endif
{
p_vout->p_sys->p_win->i_width = p_vout->p_sys->p_win->i_width =
DisplayWidth( p_vout->p_sys->p_display, DisplayWidth( p_vout->p_sys->p_display,
p_vout->p_sys->i_screen ); p_vout->p_sys->i_screen );
...@@ -1576,6 +1605,8 @@ static void ToggleFullScreen ( vout_thread_t *p_vout ) ...@@ -1576,6 +1605,8 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
p_vout->p_sys->i_screen ); p_vout->p_sys->i_screen );
} }
}
XMoveResizeWindow( p_vout->p_sys->p_display, XMoveResizeWindow( p_vout->p_sys->p_display,
p_vout->p_sys->p_win->base_window, p_vout->p_sys->p_win->base_window,
p_vout->p_sys->p_win->i_x, p_vout->p_sys->p_win->i_x,
......
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