[openbox] fullscreen mplayer

Marc Wilson msw at cox.net
Wed Sep 17 22:25:31 EDT 2003


On Wed, Sep 17, 2003 at 12:59:48PM +0200, Peter Chiocchetti wrote:
> mplayer too is short before a (1.0) release. with openbox, in
> fullscreen it stays below the gnome panel. definitley, thats
> wrong :) is it the wms or mplayers fault?

It's mplayer's fault.

> does the _NET_WM_STATE hint request the window to be layered
> on top?

Yes.  And that's the problem.  Mplayer asks to be set above all other
windows, but toolbars and docks always win (look at the properties of the
panel).

> _NET_WM_STATE(ATOM) = _NET_WM_STATE_ABOVE

What mplayer SHOULD be setting is _NET_WM_STATE_FULLSCREEN, but it has a
stupid bug and thus tries ABOVE first.  The below patch should adjust for
it:

Index: libvo/x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.149
diff -p -u -d -r1.149 x11_common.c
--- libvo/x11_common.c  12 Aug 2003 20:54:12 -0000      1.149
+++ libvo/x11_common.c  8 Sep 2003 16:22:35 -0000
@@ -230,17 +230,6 @@ static int vo_wm_detect(void)
    for (i = 0; i < nitems; i++)
      wm |= net_wm_support_state_test (args[i]);
    XFree( args );
-   // ugly hack for broken OpenBox _NET_WM_STATE_FULLSCREEN support
-   // (in their implementation it only changes internal state of window, nothing more!!!)
-   if (wm & vo_wm_FULLSCREEN)
-   {
-      if (x11_get_property(XA_BLACKBOX_PID, &args, &nitems))
-       {
-           mp_msg( MSGT_VO,MSGL_V,"[x11] Detected wm is a broken OpenBox.\n" );
-           wm ^= vo_wm_FULLSCREEN;
-       }
-      XFree (args);
-   }
   }
 
  if ( wm == 0 ) mp_msg( MSGT_VO,MSGL_V,"[x11] Unknown wm type...\n" );
@@ -819,11 +808,11 @@ void vo_x11_setlayer( Display * mDisplay
    if ( vo_fs_type & vo_wm_STAYS_ON_TOP )
      xev.data.l[1]=XA_NET_WM_STATE_STAYS_ON_TOP;
    else
-   if ( vo_fs_type & vo_wm_ABOVE )
-     xev.data.l[1]=XA_NET_WM_STATE_ABOVE;
-   else
    if ( vo_fs_type & vo_wm_FULLSCREEN )
      xev.data.l[1]=XA_NET_WM_STATE_FULLSCREEN;
+   else
+   if ( vo_fs_type & vo_wm_ABOVE )
+     xev.data.l[1]=XA_NET_WM_STATE_ABOVE;
    else
    if ( vo_fs_type & vo_wm_BELOW )
      // This is not fallback. We can safely assume that situation where

The first hunk actually looks for openbox2, which has an... interesting
idea of what FULLSCREEN means.

The second one inverts the tests so that it tries FULLSCREEN *before* it
tries ABOVE.

I didn't create the patch, I just share it. :)

-- 
 Marc Wilson |     The naked truth of it is, I have no shirt.  --
 msw at cox.net |     William Shakespeare, "Love's Labour's Lost"



More information about the openbox mailing list