Hi Stephan,

On 22 October 2013 16:27, Stephan Maximilian Huber <
[email protected]> wrote:

> There's no task bar on osx, my changes affect the application menu-bar
> which is pinned at the top of the screen. Afaik there's no such concept on
> other platforms.
>

After posting my reply earlier I did a search online to look at the issue,
and yep the task bar isn't the same thing as an OSX menu bar, which is
actually a more traditional menu bar in function, but just placed where you
might otherwise expect a task bar in other OS's.



> >  I also inclined to think that default should something like
> MENUBAR/TASKBAR_DO_NOT_SET.
>
> I'd stick to AUTO_HIDE, as this mimics the previous behavior on os x. If a
> window gets fullscreen, the menu gets hidden, and reveals itself again, if
> the mouse is near the menu. If we change that to do_not_set all fullscreen
> windows on os x won't be fullscreen anymore.
>
> I think I should find another way to set the menubar behavior as it's too
> platform specific and asserts functionality which is not available on other
> platforms.
>
> All I want is some sort of mechanism to set some platform-specific
> attributes for the WindowSystemInterface before it gets constructed (and
> use command-line-options/env-vars to specify these parameters).
>
> Something like an options-object for GraphicsWindowingInterface with
> several virtual methods which get fired when parsing the command line, etc.
> Platform-specific GraphicsWindowingInterface can create subclasses for
> their platform-specific
>
> Here's some pseudo-code:
>
> class  osg::GraphicsContext::WindowingSystem::Options : public
> osg::Referenced {
> public:
>        virtual void readEnvironmentalVariables() {}
>
>        virtual void readCommandLine(ArgumentParser& arguments) {}
> };
>
> class CocoaWindowingSystemOptions : public
> osg::GraphicsContext::WindowingSystem::Options {
> public:
>  // platform-specific stuff
> };
>
>
> #ifdef _APPLE_
>         CocoaWindowingSystemOptions* options = new
> CocoaWindowingSystemOptions();
>         // set the behavior per code
>         options->setMenuBarBehavior(…);
>
>         osg:: GraphicsContext
> ::GraphicsWindowingSystem::setOptions(options);
> #endif
>
>
> IMHO this is the cleanest approach. What do you think?


It's a more complicated approach, but I'm not convinced it's cleaner.  I'm
not sure what the cleanest approach is yet.

As this is a platform specific feature then perhaps naming the property
with a OSX prefix would be appropriate, if one doesn't make this explict in
the naming then doxygen docs could be added to make it clear that it only
applies to OSX.  For parsing env var settings and command line args we
already have the osg::DisplaySettings object so would be inclined to be
pragmatic and just reuse this as you have already done.

Putting controls in OSX specific Options objects would require P3D and
other applications to have a specific Cocoa code path that is #ifdef'd out
for all other platforms.  I'd much prefer to avoid this.

Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to