[vlc-devel] commit: [x11 vout] Fix x11 fullscreen behaviour. Patch by Raster! ( Jean-Baptiste Kempf )

git version control git at videolan.org
Thu Oct 16 15:56:52 CEST 2008


vlc | branch: 0.9-bugfix | Jean-Baptiste Kempf <jb at videolan.org> | Thu Oct 16 01:10:32 2008 +0200| [613da31f1141ba4ceddaccd0d96ff9bc7020a24d] | committer: Jean-Baptiste Kempf 

[x11 vout] Fix x11 fullscreen behaviour. Patch by Raster!

This fix e17, Xfce on my configuration.
Thanks very much Raster.
(cherry picked from commit 2229045e62f26bdfeacdcded3064f8d61955cfeb)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=613da31f1141ba4ceddaccd0d96ff9bc7020a24d
---

 modules/video_output/x11/xcommon.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/modules/video_output/x11/xcommon.c b/modules/video_output/x11/xcommon.c
index 3ba2e00..d239137 100644
--- a/modules/video_output/x11/xcommon.c
+++ b/modules/video_output/x11/xcommon.c
@@ -2166,11 +2166,28 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
                         (XEvent*)&event );
         }
 
+/* "bad fullscreen" - set this to 0. doing fullscreen this way is problematic
+ * for many reasons and basically fights with the window manager as the wm
+ * reparents AND vlc goes and reparents - multiple times. don't do it. it just
+ * makes it more inefficient and less "nice" to the x11 citizenry. this turns
+ * it off */
+#define BADFS 0
+/* explicitly asking for focus when you fullscreened is a little silly. the
+ * window manager SHOULD be handling this itself based on its own focus
+ * policies. if the user is "using" a given xinerama/xrandr screen or x11
+ * multihead screen AND vlc wants to fullscreen the wm should also focus it
+ * as its the only thing on the screen. if vlc fullscreens and its on
+ * "another monitor" to the one the user is using - this may "steal" the focus
+ * as really the wm should be deciding if, on fullscreening of a window
+ * the focus should go there or not, so let the wm decided */
+#define APPFOCUS 0
         /* Make sure the change is effective */
+#if BADFS // RASTER: why do this? you already mapped the window in CreateWindow?
         XReparentWindow( p_vout->p_sys->p_display,
                          p_vout->p_sys->p_win->base_window,
                          DefaultRootWindow( p_vout->p_sys->p_display ),
-                         0, 0 );
+                         -2, -2 );
+#endif
 
 #ifdef HAVE_XINERAMA
         if( XineramaQueryExtension( p_vout->p_sys->p_display, &i_d1, &i_d2 ) &&
@@ -2261,6 +2278,7 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
         EnablePixelDoubling( p_vout );
 #endif
 
+#if APPFOCUS // RASTER: let the wm do focus policy
         /* Activate the window (give it the focus) */
         XClientMessageEvent event;
 
@@ -2282,6 +2300,7 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
                     DefaultRootWindow( p_vout->p_sys->p_display ),
                     False, SubstructureRedirectMask,
                     (XEvent*)&event );
+#endif
     }
     else
     {
@@ -2307,12 +2326,17 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
      * window has already been mapped because the XMapWindow() request
      * has not necessarily been sent directly to our window (remember,
      * the call is first redirected to the window manager) */
+
+#if BADFS // RASTER: this is silly... if we have already mapped before
     do
     {
         XWindowEvent( p_vout->p_sys->p_display,
                       p_vout->p_sys->p_win->base_window,
                       StructureNotifyMask, &xevent );
     } while( xevent.type != MapNotify );
+#else
+   XSync(p_vout->p_sys->p_display, False);
+#endif
 
     /* Be careful, this can generate a BadMatch error if the window is not
      * already mapped by the server (see above) */




More information about the vlc-devel mailing list