[osg-submissions] GraphicsWindowCarbon Bugfixes and enhancements
Stephan Maximilian Huber
ratzfatz at digitalmind.de
Mon Mar 31 08:39:08 PDT 2008
Hi Robert,
attached you'll find some bugfixes from Tatsuhiro Nishioka (reviewed and
adapted by me) for the GraphicsWindowCarbon implementation:
> 1) setCursor was not implemented; now implemented for some cursor
> type (sorry, not all of them)
> I'm not sure if using SetThemeCursor, Show/HideCursor is right
> way since these are deprecated.
I added Tat's implementation(which ids deprecated), personally I did not
implement setCursor for Mac OS X, because there's only a cocoa-way to
set the cursor, which is not deprecated, and I didn't want to introduce
more warnings.
IMHO is the cursor-interface suboptimal, it tries to mimick the
GLUT-cursors, which are not available on every platform. Perhaps we
should refactor the cursor-stuff, so that the user can create
mouse-cursors from osg::Images, and we can support missing cursors per
platform better via osg::Images created from source-code.
à la virtual osgViewer::Cursor* createCursor(osg::Image* img, const
osg::Vec2& hotspot);
This would be a lot of work, but the most work is platform-independent
code, the platform-specific part is only the createCursor-method. I
think it doesn't make any sense to implement the missing cursors for
Win32 and also for OS X again. And the user can create custom cursor
shapes with just one call :-)
Just an idea ;-)
> However, I don't see any substitutable funcs for these.
> 2) segfault/bus error on exit at MenubarController::detachWindow
> This happened when detachWindow was called by closeImplementation.
> The cause is that MenubarController::instance returns NULL.
> I guess ref_ptr already release its pointer on destruction, but
> not so sure.
This seems to be a problem with the order of static destructors, the
d'tor of the singleton MenubarController is called before the d'tor of
GraphicsWindowCarbon under certain circumstances.
> 3) Window was not activated by clicking on window content area.
> Actually there was no active/inactive check in the code so menu
> item is selected even window was inactive.
> so I added some code to check if active on mouse event. if not,
> it returns false to delegate event to default handler.
Another small question: how should I deal with additional source-files
for the graphicsWindowCarbon-implementation? How should they be named
and where should they be placed? (no public headers, just some stuff to
add the carbon-cocoa-bridge)
cheers,
Stephan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: update_graphicsWindowCarbon.zip
Type: application/x-zip-compressed
Size: 14371 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080331/d54dabd2/attachment-0001.bin
More information about the osg-submissions
mailing list