[MPlayer-G2-dev] pre41 released + aspect + fullscreen

Arpi arpi at thot.banki.hu
Fri Aug 22 03:09:43 CEST 2003


Hi,

> About the fullscreen switching: Fabian's patch "ported" most of the x11
> fs code from g1 as-is. The main idea behind the 2 windows fs switching is to
> avoid all that mess. At least it works in xine, i remember seeing a half
> screen long fs switching code there using 2 windows. No messing with WM
> hints, etc, just create a window with some special flags. I'm not an X11
> guru, not even a X11 newbie, so i can't decide hwo can it be done, but I
> think (at least hope) that porting that mess from g1 is not the Right Way.
> Note, that gtk and SDL also uses 2 window method for fs switch, and they
> both work since ages, without the need for that fs mess and commandline
> switches and WM patches we hacked together in g1.

/xine-lib/doc/hackersguide/hackersguide.sgml:1581:
      <title>Source code of a simple X11 frontend</title>
..

  window[0] = XCreateSimpleWindow(display, XDefaultRootWindow(display),
                                  xpos, ypos, width, height, 1, 0, 0);

  window[1] = XCreateSimpleWindow(display, XDefaultRootWindow(display),
                                  0, 0, (DisplayWidth(display, screen)),
                                  (DisplayHeight(display, screen)), 0, 0, 0);

  XSelectInput(display, window[0], (ExposureMask | ButtonPressMask | KeyPressMask |
                                ButtonMotionMask | StructureNotifyMask |
                                PropertyChangeMask | PointerMotionMask));

  XSelectInput(display, window[1], (ExposureMask | ButtonPressMask | KeyPressMask |
                                ButtonMotionMask | StructureNotifyMask |
                                PropertyChangeMask | PointerMotionMask));

  XA_NO_BORDER         = XInternAtom(display, "_MOTIF_WM_HINTS", False);
  mwmhints.flags       = MWM_HINTS_DECORATIONS;
  mwmhints.decorations = 0;
  XChangeProperty(display, window[1],
                  XA_NO_BORDER, XA_NO_BORDER, 32, PropModeReplace, (unsigned char *) &amp;mwmhints,
                  PROP_MWM_HINTS_ELEMENTS);

  XMapRaised(display, window[fullscreen]);


and then the FS switching code:

        case XK_F:
          {
            Window    tmp_win;

            XLockDisplay(display);
            XUnmapWindow(display, window[fullscreen]);
            fullscreen = !fullscreen;
            XMapRaised(display, window[fullscreen]);
            XSync(display, False);
            XTranslateCoordinates(display, window[fullscreen],
                                  DefaultRootWindow(display),
                                  0, 0, &amp;xpos, &amp;ypos, &amp;tmp_win);
            XUnlockDisplay(display);

            xine_gui_send_vo_data(stream, XINE_GUI_SEND_DRAWABLE_CHANGED,
                                  (void*) window[fullscreen]);
          }
          break;


So, this seems to be quite clean and easy, at least compared to g1's
x11_common.c or Fabian's patches :)


A'rpi / Astral & ESP-team

--
Developer of MPlayer G2, the Movie Framework for all - http://www.MPlayerHQ.hu



More information about the MPlayer-G2-dev mailing list