Hi All,

A bug that has been niggling me for quite some time now is that under
the last few rev's of X11 window managers under linux that toggling of
fullscreen on/off has been broken.  The problem appears when you one a
window fullscreen and then try to toggle off full screen, for instance
run "osgviewer cow.osg" and the press 'f', what you see if a
fullscreen app with no window decoration becoming a smaller window
with normal window decoration - instead you just see a quick frame of
rendering with a smaller viewport before the window manager jumps back
in a resizes the window fullscreen again.

Frustratingly the OSG's GraphicsWindowX11.cpp has actually being tell
the X11 window to move to a small size and toggle on the window
decoration, but the window manager jumps in a resizes the
window/adjusts the window decoration back to full screen.  The way you
can see that it's the window manager taking control is to switch off
this control via enabling the Traits::overrideRedirect - here the X11
window just does what you tell it do, be that full screen or a small
window, there is a but though - switching off the window managers
control also switch off all the window decoration that the window
manager adds so it's not a real solution, just a good illustration of
the issue.

Over the weekend I looked into the issue and did lots of different
experiements to find out what was going on and finally believe I've
got the bottom of it, hence the above high level explanation, I have
also now come up with a workaround albeit a bit hacky.  The workaround
happens only when we only a window fullscreen initially, but when we
are opening up a full screen window we reate the X11 window at a
smaller size than fullsize - this gives the window manager a non full
screen size to work with, and then subsequent calls to set the window
decoration tell the window manager that the window is actually full
screen so it then jumps in a changes the window size to full screen
automatically.  You never see the smaller window size appear on
screen, it just appears full screen so you are never aware of this
workaround.  Finally when you do toggle off fullscreen the window
manager has a previous non full screen sized window to refer to and
happily resizes it and then allows the OSG's X11 window
resize/position calls to work as intended.

It's realize the workaround is a bit goofy but works reliably on my
KDE 4.6 system - so for the first time in a couple of years full
screen toggling is working as nature intended which is a great relief.
 However, I do relize that this is just one window manager so this
workaround needs testing far more widely.   I have added code to
detect the new X11 atoms used by modern X11 window managers and only
use the workaround when these are available so these changes shouldn't
affect older X11 systems.  However, this all needs testing.

I will install Gnome on one of my systems today to check it works.  I
can't test older X11 system though - such as IRIX, Solaris, HP-Ux,
FreeBSD etc.  Could members of the community check out OSG svn/trunk
and let me know how things work out.

If the testing goes well I will merge this workaround into the
OpenSceneGraph-3.0 branch so it'll be part of the 3.0.0-rc2.

Thanks in advance for you help testing,
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to