[osg-users] patch to add WMclass to osgViewer

0 views
Skip to first unread message

S Andreason

unread,
Aug 22, 2009, 5:13:37 PM8/22/09
to osg-...@lists.openscenegraph.org
Hi,

When I open the Window Attributes (in WindowManager in X on linux) I am
unable to save any changes to the attributes in the resource database,
because the osg window does not have a class defined. The Window
Specification and Save buttons are greyed out.

For example, when running FlightGear, I want the window to always have
no title, so it opens full-screen without using the --full-screen
option, which would prevent other windows from moving above the osg window.

I am attaching a patch I made to fix this problem.

Thank you,
Stewart

classHints.diff

Robert Osfield

unread,
Nov 20, 2009, 6:27:24 AM11/20/09
to OpenSceneGraph Users
Thanks Stewart, change now merged and submitted to svn/trunk. For
future submissions could you send the whole modified file as I find
this far more reliable than using patch, as patch can mess up.
Cheers, Robert.

> ---
> /usr/src/SVN/OpenSceneGraph/src/osgViewer/.svn/text-base/GraphicsWindowX11.cpp.svn-base
>     Sat Aug 22 10:02:06 2009
> +++ GraphicsWindowX11.cpp       Sat Aug 22 14:03:51 2009
> @@ -728,6 +728,12 @@
>     }
>
>
> +    // Give window a class so that user preferences can be saved in the
> resource database.
> +    XClassHint clH;
> +    clH.res_name = (char *)"OSG";
> +    clH.res_class = (char *)"osgViewer";
> +    XSetClassHint( _display, _window, &clH);
> +
>     // This positions the window at _windowX, _windowY
>     XSizeHints sh;
>     sh.flags = 0;
>
> _______________________________________________
> osg-users mailing list
> osg-...@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply all
Reply to author
Forward
0 new messages