Fullscreen mode



Hi!

Thanks for the good replies and illustrative examples on my last
question! Now I have a more complex question.

My app uses a Socket to embed Mplayer. Since Mplayer needs the socket to
be packed through its entire lifetime, I'm having some difficulties in
implementing a fullscreen mode. This is how I do it now:

When going into fullscreen mode, I unpack all widgets outside the
socket, set the window margins to zero, resize the socket the size of
the screen, and call $window->fullscreen. When leaving fullscreen, I
repack all other widgets, remove the size request from the socket, and
call $window->unfullscreen. This works fine, except that the window is
HUGE afterwards, because it attains the size that the socket had in
fullscreen mode ( = the screen size) PLUS the size of all other widgets.

To solve this, I store the window size through $window->get_size before
going into fullscreen, and try to go back to this size with
$window->resize when leaving fullscreen. This sometimes works, and
sometimes has no effect, completely at random. I suspect I have a race
condition, where sometimes the window first adjusts to all its children,
and then is resized through my explicit resize call, and everything is
fine, but sometimes (actually most of the time) those two events happen
in the opposite order and the window ends up huge. How do I properly set
up the resize command to be called after all other automatic resizes (I
can se there are a couple of them occuring through a print statement)?

/Pelle

PS. Before you ask, I am considering to switch to GStreamer some day,
but right now I want a quick solution to this last problem to make my
app fully working.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]