[MPlayer-dev-eng] GUI and vo_x11 functions
Alexander Strasser
eclipse7 at gmx.net
Sat Sep 10 15:33:52 CEST 2011
Hi Ingo,
Ingo Brückl wrote:
> After reworking the GUI fullscreen code, there are two vo_x11 functions left
> which I'd like to use, but currently can't.
>
> vo_x11_setlayer() is blocked by WinID >= 0, vo_x11.1.patch could unblock it.
OK
> (If accepted, we probably should likewise patch vo_x11_border()
> [vo_x11.2.patch], although I don't need that, because I'm using an own
> GUI decoration function.)
OK
> vo_x11_sizehint() uses global mDisplay and vo_window and I'd need these as
> parameters as in vo_x11.3.patch. (But I could use own sizehint code which is
> in the GUI function that creates a window just as well. This code could be
> extracted into an own function and called then, which may be the better
> solution.)
I think it is OK doing it this way.
In general I am a bit concerned about the WinID handling inside
the x11_common and the x11 based vo drivers. But I think it is not
worse with the patches.
Maybe wait a day or two for additional comments from Reimar.
Nice work!
> Index: libvo/x11_common.c
> ===================================================================
> --- libvo/x11_common.c (revision 34097)
> +++ libvo/x11_common.c (working copy)
> @@ -1206,7 +1206,7 @@
>
> void vo_x11_setlayer(Display * mDisplay, Window vo_window, int layer)
> {
> - if (WinID >= 0)
> + if (!WinID)
> return;
>
> if (vo_fs_type & vo_wm_LAYER)
> @@ -1431,7 +1431,7 @@
> {
> vo_ontop = (!(vo_ontop));
>
> - vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
> + if (WinID < 0) vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
> }
>
> void vo_x11_border(void)
> Index: libvo/vo_dxr2.c
> ===================================================================
> --- libvo/vo_dxr2.c (revision 34097)
> +++ libvo/vo_dxr2.c (working copy)
> @@ -719,7 +719,7 @@
> break;
> }
>
> - if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
> + if (vo_ontop && WinID < 0) vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
>
> // start playing
> if(ioctl(dxr2_fd, DXR2_IOC_PLAY, NULL) == 0) {
> Index: libvo/x11_common.c
> ===================================================================
> --- libvo/x11_common.c (revision 34097)
> +++ libvo/x11_common.c (working copy)
> @@ -1437,7 +1437,7 @@
> void vo_x11_border(void)
> {
> vo_border = !vo_border;
> - vo_x11_decoration(mDisplay, vo_window, vo_border && !vo_fs);
> + if (WinID < 0) vo_x11_decoration(mDisplay, vo_window, vo_border && !vo_fs);
> }
>
> /*
> Index: libvo/x11_common.c
> ===================================================================
> --- libvo/x11_common.c (revision 34097)
> +++ libvo/x11_common.c (working copy)
> @@ -942,7 +942,7 @@
> */
> void vo_x11_nofs_sizepos(int x, int y, int width, int height)
> {
> - vo_x11_sizehint(x, y, width, height, 0);
> + vo_x11_sizehint(mDisplay, vo_window, x, y, width, height, 0);
> if (vo_fs) {
> vo_old_x = x;
> vo_old_y = y;
> @@ -957,7 +957,7 @@
> }
> }
>
> -void vo_x11_sizehint(int x, int y, int width, int height, int max)
> +void vo_x11_sizehint(Display * dpy, Window win, int x, int y, int width, int height, int max)
> {
> vo_hint.flags = 0;
> if (vo_keepaspect)
> @@ -999,7 +999,7 @@
>
> vo_hint.flags |= PWinGravity;
> vo_hint.win_gravity = StaticGravity;
> - XSetWMNormalHints(mDisplay, vo_window, &vo_hint);
> + XSetWMNormalHints(dpy, win, &vo_hint);
> }
>
> static int vo_x11_get_gnome_layer(Display * mDisplay, Window win)
> @@ -1410,7 +1410,7 @@
> if ( ! (vo_fs_type & vo_wm_FULLSCREEN) ) // not needed with EWMH fs
> {
> vo_x11_decoration(mDisplay, vo_window, vo_border && !vo_fs);
> - vo_x11_sizehint(x, y, w, h, 0);
> + vo_x11_sizehint(mDisplay, vo_window, x, y, w, h, 0);
> vo_x11_setlayer(mDisplay, vo_window, vo_fs);
>
>
> Index: libvo/x11_common.h
> ===================================================================
> --- libvo/x11_common.h (revision 34097)
> +++ libvo/x11_common.h (working copy)
> @@ -66,7 +66,7 @@
> void vo_x11_decoration( Display * vo_Display,Window w,int d );
> void vo_x11_classhint( Display * display,Window window,const char *name );
> void vo_x11_nofs_sizepos(int x, int y, int width, int height);
> -void vo_x11_sizehint( int x, int y, int width, int height, int max );
> +void vo_x11_sizehint( Display * dpy, Window win, int x, int y, int width, int height, int max );
> int vo_x11_check_events(Display *mydisplay);
> void vo_x11_selectinput_witherr(Display *display, Window w, long event_mask);
> int vo_x11_update_geometry(void);
Alexander
More information about the MPlayer-dev-eng
mailing list