[osg-users] BUG?: mouse coordinate changes after window move

Leif Delgass ldelgass at gmail.com
Fri Sep 21 07:51:32 PDT 2007


On 9/21/07, Robert Osfield <robert.osfield at gmail.com> wrote:
> HI Lief,
>
> Thanks for the looking into this.  I'm open to your suggest for a
> virtual fullscreen method.  Possible this could be wrapped up into the
> setWindowRectangleImplementation which is automatically detects that
> the dimensions are fullsize.  Any changes we make will need rolling
> out to Win32 and Carbon as well.

I just tried the approach of setting the fullscreen state in
setWindowRectangleImplementation,  and this works without changing the
GraphicsWindow base class.  The only issue is: it has the side effect
that changing the window size to the screen size through
setWindowRectangle makes the window fullscreen, even if the window
decorations have not been disabled through setWindowDecoration (this
also leaves the windowDecoration context trait out of sync unless I
set it to false in setWindowRectangle when going fullscreen).

That means, for example, that cycling through the windowed resolutions
with <,> in osgviewer will put the window into fullscreen when you
reach the screen resolution (and back to windowed when you reduce the
resolution).  I could check the decoration trait (in addition to
window size) to determine if the window should be fullscreen, but that
would mean you'd need to turn decorations on/off before setting the
window size (ViewerEventHandler uses this order, but it could be a
source of confusion).  I suppose I could also add the screen size
dimensions check and fullscreen state code in the
setWindowDecorationImplementation, so that disabling decorations with
a screen size window goes into fullscreen.  What are your thoughts on
this?

By the way, I found that GNOME/metacity does also honor the Motif
hints regarding decorations, but the fullscreen state is the only way
I've found to get top-level stacking of a window.  Leaving the
fullscreen state only adds window decorations back if they haven't
been disabled with the Motif hint.

> Would you be able to try out tweaking GraphicsWindow/GraphicsWindowX11
> to see if you can get the new window hints working?
>
> Robert.
>
> On 9/20/07, Leif Delgass <ldelgass at gmail.com> wrote:
> > On 9/20/07, Robert Osfield <robert.osfield at gmail.com> wrote:
> > > On 9/20/07, Anders Backman <andersb at cs.umu.se> wrote:
> > > > Problem 2 (windowed):
> > > >
> > > > We are using gnome on Ubuntu, and
> > > >   osgviewer --window 100 100 500 500 cow.osg
> > > >
> > > > works fine, but after 'f' is pressed two times (first into fullscreen, and
> > > > then back to windows), we dont get a window.
> > > > So it seems that it is not possible to go back from fullscreen  windowed
> > > > mode.
> > >
> > > This is a bug in the window manager ignoring request to add decoration
> > > back in.  It might be possible to code a workaround for working with
> > > such windowing managers but alas I can't divine what the problem might
> > > be as everything works just fine on all my linux boxes.
> > >
> > >  Robert.
> >
> > Hi Robert,
> >
> > I have been experimenting with window manager hints regarding a
> > different but related issue.  I'm running GNOME under Fedora 5, and
> > the fullscreen mode in osgviewer creates a window that stays under the
> > top and bottom toolbar panels.   For me, switching to windowed mode
> > properly adds the window decorations.  But what I discovered is that
> > to get true fullscreen windows in GNOME, I need to use the Extended
> > Window Manager Hints (EWMH):
> >
> > http://standards.freedesktop.org/wm-spec/wm-spec-latest.html
> >
> > Sending a ClientMessage event (or using XChangeProperty before mapping
> > the window) to toggle the _NET_WM_STATE_FULLSCREEN Atom for the
> > _NET_WM_STATE property works as expected -- the window is undecorated
> > and appears on top of the toolbars in fullscreen state.  I was looking
> > into the OSG implementation and it seems that fullscreen is
> > implemented using a window resize to screen dimensions + the Motif
> > window manager hints to remove decorations.  The EWMH spec is intended
> > to replace Motif hints, and it has a slightly different philosophy.
> > You specify the usage/type of window rather than directly controlling
> > the use of decorations.
> >
> > I think what would be needed is a virtual fullscreen() method in
> > GraphicsWindow that can be overriden in GraphicsWindowX11 using this
> > implementation if the window manager supports it, and then the
> > toggleFullscreen() method in ViewerEventHandler could call this
> > function rather than setting the window rectangle and decoration (in
> > the EWMH spec, the window manager is responsible for restoring the
> > original window geometry and decoration when leaving fullscreen
> > state).
> >
> > --
> > Leif Delgass
> > ldelgass at gmail.com

-- 
Leif Delgass
ldelgass at gmail.com



More information about the osg-users mailing list