[MPlayer-dev-eng] GUI and vo_x11 functions

Ingo Brückl ib at wupperonline.de
Tue Sep 13 02:41:16 CEST 2011


Reimar Döffinger wrote on Mon, 12 Sep 2011 23:39:58 +0200:

> The messup I see is in modifying the state of a window we did not create
> or manage in any way.

Ok, I get this, but doesn't that contradict the idea of reusing the vo_x11
code? Isn't the driver supposed to manage windows (-wid) it didn't create?
Why not allowing an application owning a WinID to use the decoration code
for its window if it is safe to do so?

Take vo_x11_ewmh_fullscreen() for example. It probably shouldn't be called
if the driver deals with the root window, so there should be a "if (!WinID)
return;". If "modifying the state of a window we did not create or manage in
any way" is mandatory, then there should be even a "if (WinID >= 0) return;"
and the function could not be reused. Currently vo_x11_ewmh_fullscreen() is
completely "open" and WinID >= 0 is assured in vo_x11_fullscreen() from where
it is called.

So the question is: Where should be the WinID check? Inside the function
to protect it (no reusability), or there from where the function gets
called (lots of WinID conditions)?
And, shall we use WinID == 0 (actual meaning: vo_window == mRootWin),
WinID < 0 (actual meaning: vo_window != WinID) and WinID > 0 (actual
meaning: vo_window == WinID), or rather the actual meanings?

It may be a good idea to follow Alexander's suggestion to clean up/improve
the code handling around the WinID variable first.

We can either block the functions by a condition inside or leave it as open
as possible to enable reusage (either directly by the GUI or via VOCTRL
calls).

Ingo


More information about the MPlayer-dev-eng mailing list