[MPlayer-dev-eng] vo_x11_sizehint and fullscreen

Attila Kinali attila at kinali.ch
Sun Sep 5 10:31:39 CEST 2004


Moin,

I just stumbled over a strange bug while i wanted to watch da capo.
When switching to fullscreen, i got a window that was a few pixels to
short and thus a bit of the taskbar of icewm was still visible. While
trying to find out what's going on i found the following:

xwininfo on the root window:
---
xwininfo: Window id: 0x48 (the root window) (has no name)

  Absolute upper-left X:  0
  Absolute upper-left Y:  0
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 1024
  Height: 768
[...]
  -geometry 1024x768+0+0
---

xwininfo on the fullscreen mplayer window:
---
xwininfo: Window id: 0x1e00002 "MPlayer"

  Absolute upper-left X:  0
  Absolute upper-left Y:  0
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 1360
  Height: 765
[...]
  Corners:  +0+0  --336+0  --336-3  +0-3
  -geometry 1360x765+0+0
---

Yes, it's true, the MPlayer window is a lot wider than the screen
itself, but a little bit shorter. More interstingly, i get a correct
sized fullscreen window if i start with -fs and even toggling between
fullscreen and windowed mode doesnt change it.

The problem here lies in the calling of vo_x11_sizehint or, actualy that
it is not called. In my case (using icewm 1.2.14 from debian)
vo_x11_sizehint is only called once by vo->config() thus setting the
aspect of the window. When switching to full screen, icewm forces this
aspect onto the window again, which results in this strange window
size. When starting with -fs vo_x11_sizehint is not called by
vo->config() thus the window aspect ratio is never set, which is why it
works then fine. A quick test with -nokeepaspect gave the same, working
result.

This now explains also why my "fix" of the aspect settings for the
window in february (<20040224200820.D9ECD3175E at mail.mplayerhq.hu> on -cvslog)
broke for quite a few wms, but mine.

So, we have currently 2 bugs, one, that the aspect is wrongly set, is
simple to fix (just apply my patch again). The other one, that
vo_x11_sizehint isnt called when it actualy has to, is a bit harder
as it has a lot of side effects and i'm not sure what the right way is.

One way could be to call vo_x11_sizehint every time when we change the
window size. Though this sounds straight forward, i'm sure it will
break for at least half of the wms. Another way would be to move the
aspect setting out of vo_x11_sizehint and call it always when we switch
between fullscreen and windowed mode.

Any other ideas ?

Interesting is that this bug was not discovered until now. It must be
present for at least a year.


			Attila Kinali




More information about the MPlayer-dev-eng mailing list