]> git.sesse.net Git - vlc/commitdiff
* modules/video_output/x11/*, configure.ac.in: Xinerama support remotely based from...
authorGildas Bazin <gbazin@videolan.org>
Sun, 25 May 2003 19:24:53 +0000 (19:24 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 25 May 2003 19:24:53 +0000 (19:24 +0000)
configure.ac.in
modules/video_output/x11/x11.c
modules/video_output/x11/xcommon.c
modules/video_output/x11/xcommon.h
modules/video_output/x11/xvideo.c

index 72b4f4edd5b5b3c0ab1757cd498e91cc43092d04..76a3f694ea48a3534799a0b455d08351ecdaabd1 100644 (file)
@@ -514,25 +514,6 @@ NEED_GNOME2_MAIN=no
 dnl build the qte plugin ?
 NEED_QTE_MAIN=no
 
-dnl Check for DPMS
-if test "x${SYS}" != "xmingw32"
-then
-  CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
-  AC_CHECK_HEADERS(X11/extensions/dpms.h, [
-    AC_MSG_CHECKING(for DPMSInfo in X11/extensions/dpms.h)
-    AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
-      AC_MSG_RESULT(yes)
-      AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
-                Define if <X11/extensions/dpms.h> defines DPMSInfo.)
-    ],[
-      AC_MSG_RESULT(no)
-    ])
-  ],,[
-    #include <X11/Xlib.h>
-  ])
-  CPPFLAGS="${CPPFLAGS_save}"
-fi
-
 dnl Check for ntohl, etc.
 AC_CACHE_CHECK([for ntohl in sys/param.h],
     [ac_cv_c_ntohl_sys_param_h],
@@ -1962,6 +1943,25 @@ dnl
 
 AC_ARG_WITH(,[Video plugins:])
 
+dnl Check for DPMS
+if test "x${SYS}" != "xmingw32"
+then
+  CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
+  AC_CHECK_HEADERS(X11/extensions/dpms.h, [
+    AC_MSG_CHECKING(for DPMSInfo in X11/extensions/dpms.h)
+    AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
+      AC_MSG_RESULT(yes)
+      AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
+                Define if <X11/extensions/dpms.h> defines DPMSInfo.)
+    ],[
+      AC_MSG_RESULT(no)
+    ])
+  ],,[
+    #include <X11/Xlib.h>
+  ])
+  CPPFLAGS="${CPPFLAGS_save}"
+fi
+
 dnl
 dnl  X11 module
 dnl  (enabled by default except on win32)
@@ -1975,6 +1975,11 @@ if test "x${enable_x11}" != "xno" &&
     PLUGINS="${PLUGINS} x11"
     LDFLAGS_x11="${LDFLAGS_x11} -L${x_libraries} -lX11 -lXext"
     CPPFLAGS_x11="${CPPFLAGS_x11} -I${x_includes}"
+    AC_CHECK_HEADERS(X11/extensions/Xinerama.h, [
+      AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
+        AC_DEFINE(HAVE_XINERAMA,1,[Define this if you have libXinerama installed])
+        LDFLAGS_x11="${LDFLAGS_x11} -lXinerama")
+    ])
   ])
   CPPFLAGS="${CPPFLAGS_save}"
 fi
@@ -2004,6 +2009,11 @@ if test "x${enable_xvideo}" != "xno" &&
         :
       )
     )
+    AC_CHECK_HEADERS(X11/extensions/Xinerama.h, [
+      AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
+        AC_DEFINE(HAVE_XINERAMA,1,[Define this if you have libXinerama installed])
+        LDFLAGS_xvideo="${LDFLAGS_xvideo} -lXinerama")
+    ])
     CFLAGS="${CFLAGS_save}"
   ]
   CPPFLAGS="${CPPFLAGS_save}")
index 41d0d519db154a7b30f711ea6974b9fe6e67685e..13b7ea1153ebb1da364531e3ade37abff146e02b 100644 (file)
@@ -2,7 +2,7 @@
  * x11.c : X11 plugin for vlc
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: x11.c,v 1.7 2003/05/15 22:27:38 massiot Exp $
+ * $Id: x11.c,v 1.8 2003/05/25 19:24:53 gbazin Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -58,12 +58,20 @@ extern void E_(Deactivate) ( vlc_object_t * );
 #define SHM_LONGTEXT N_( \
     "Use shared memory to communicate between VLC and the X server.")
 
+#define SCREEN_TEXT N_("choose the screen to be used for fullscreen mode.")
+#define SCREEN_LONGTEXT N_( \
+    "Choose the screen you want to use in fullscreen mode. For instance " \
+    "set it to 0 for first screen, 1 for the second.")
+
 vlc_module_begin();
     add_category_hint( N_("X11"), NULL, VLC_TRUE );
     add_string( "x11-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT, VLC_TRUE );
     add_bool( "x11-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT, VLC_TRUE );
 #ifdef HAVE_SYS_SHM_H
     add_bool( "x11-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT, VLC_TRUE );
+#endif
+#ifdef HAVE_XINERAMA
+    add_integer ( "x11-xineramascreen", 0, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, VLC_TRUE );
 #endif
     set_description( _("X11 video output") );
     set_capability( "video output", 50 );
index e063e10fc65e695969998b4b5475621552927698..8ba538f390d937e2242da160ee1b33e0f42e88a7 100644 (file)
@@ -2,7 +2,7 @@
  * xcommon.c: Functions common to the X11 and XVideo plugins
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.c,v 1.16 2003/05/25 11:31:54 gbazin Exp $
+ * $Id: xcommon.c,v 1.17 2003/05/25 19:24:53 gbazin Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
 #   include <X11/extensions/Xvlib.h>
 #endif
 
+#ifdef HAVE_XINERAMA
+#   include <X11/extensions/Xinerama.h>
+#endif
+
 #include "xcommon.h"
 
 /*****************************************************************************
@@ -1334,6 +1338,7 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
     XEvent xevent;
     mwmhints_t mwmhints;
     XSetWindowAttributes attributes;
+    int i_d1, i_d2;
 
     p_vout->b_fullscreen = !p_vout->b_fullscreen;
 
@@ -1401,9 +1406,54 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
         p_vout->p_sys->p_win->i_height =
             DisplayHeight( p_vout->p_sys->p_display, p_vout->p_sys->i_screen );
 
+        p_vout->p_sys->p_win->i_x = 0;
+        p_vout->p_sys->p_win->i_y = 0;
+
+#ifdef HAVE_XINERAMA
+        if( XineramaQueryExtension( p_vout->p_sys->p_display, &i_d1, &i_d2 ) &&
+            XineramaIsActive( p_vout->p_sys->p_display ) )
+        {
+            XineramaScreenInfo *screens;   /* infos for xinerama */
+            int i_num_screens;
+
+            msg_Dbg( p_vout, "Using XFree Xinerama extension");
+
+#define SCREEN p_vout->p_sys->p_win->i_screen
+
+            /* Get Informations about Xinerama (num of screens) */
+            screens = XineramaQueryScreens( p_vout->p_sys->p_display,
+                                            &i_num_screens );
+
+            if( !SCREEN )
+                SCREEN = config_GetInt( p_vout,
+                                        MODULE_STRING "-xineramascreen" );
+
+            /* just check that user has entered a good value */
+            if( SCREEN >= i_num_screens || SCREEN < 0 )
+            {
+                msg_Dbg( p_vout, "requested screen number invalid" );
+                SCREEN = 0;
+            }
+
+            /* Get the X/Y upper left corner coordinate of the above screen */
+            p_vout->p_sys->p_win->i_x = screens[SCREEN].x_org;
+            p_vout->p_sys->p_win->i_y = screens[SCREEN].y_org;
+
+            /* Set the Height/width to the screen resolution */
+            p_vout->p_sys->p_win->i_width = screens[SCREEN].width;
+            p_vout->p_sys->p_win->i_height = screens[SCREEN].height;
+
+            XFree(screens);
+
+#undef SCREEN
+
+        }
+#endif
+
         XMoveResizeWindow( p_vout->p_sys->p_display,
                            p_vout->p_sys->p_win->base_window,
-                           0, 0,
+                           p_vout->p_sys->p_win->i_x,
+                           p_vout->p_sys->p_win->i_y,
                            p_vout->p_sys->p_win->i_width,
                            p_vout->p_sys->p_win->i_height );
     }
index 7b1728b15827cf66f25daa9b54e968aa635eb5b1..cd88ae0d5ced7bcd7f59cd16ecff7bfc9cc33299 100644 (file)
@@ -2,7 +2,7 @@
  * xcommon.h: Defines common to the X11 and XVideo plugins
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.h,v 1.4 2002/12/06 16:34:08 sam Exp $
+ * $Id: xcommon.h,v 1.5 2003/05/25 19:24:53 gbazin Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -51,13 +51,21 @@ typedef struct x11_window_t
     Window              base_window;                          /* base window */
     Window              video_window;     /* sub-window for displaying video */
     GC                  gc;              /* graphic context instance handler */
+
     unsigned int        i_width;                             /* window width */
     unsigned int        i_height;                           /* window height */
+    int                 i_x;                          /* window x coordinate */
+    int                 i_y;                          /* window y coordinate */
+
     Atom                wm_protocols;
     Atom                wm_delete_window;
 
     vlc_bool_t          b_owned;                   /* do we own this window? */
 
+#ifdef HAVE_XINERAMA
+    int                 i_screen;
+#endif
+
 } x11_window_t;
 
 /*****************************************************************************
index 8eb324416429018f0ffc8c6d04a3342d6cc1341c..4e9f1aa543d7198d8184a459227f213ce83a0d92 100644 (file)
@@ -2,7 +2,7 @@
  * xvideo.c : Xvideo plugin for vlc
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: xvideo.c,v 1.7 2003/05/15 22:27:38 massiot Exp $
+ * $Id: xvideo.c,v 1.8 2003/05/25 19:24:53 gbazin Exp $
  *
  * Authors: Shane Harper <shanegh@optusnet.com.au>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -69,6 +69,11 @@ extern void E_(Deactivate) ( vlc_object_t * );
 #define SHM_LONGTEXT N_( \
     "Use shared memory to communicate between VLC and the X server.")
 
+#define SCREEN_TEXT N_("choose the screen to be used for fullscreen mode.")
+#define SCREEN_LONGTEXT N_( \
+    "Choose the screen you want to use in fullscreen mode. For instance " \
+    "set it to 0 for first screen, 1 for the second.")
+
 vlc_module_begin();
     add_category_hint( N_("XVideo"), NULL, VLC_TRUE );
     add_string( "xvideo-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT, VLC_TRUE );
@@ -78,6 +83,10 @@ vlc_module_begin();
 #ifdef HAVE_SYS_SHM_H
     add_bool( "xvideo-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT, VLC_TRUE );
 #endif
+#ifdef HAVE_XINERAMA
+    add_integer ( "xvideo-xineramascreen", 0, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, VLC_TRUE );
+#endif
+
     set_description( _("XVideo extension video output") );
     set_capability( "video output", 150 );
     set_callbacks( E_(Activate), E_(Deactivate) );