Hi Mark and Robert,

The default case bug was the other change I submitted. But I totally
missed the point that the original author use setCursor to set the
pointer for resizing, thus overwrite _appMouseCursor.
So the use of a setCursorImpl function that doesn't affect
_appMouseCursor is the right thing to do.

Thank you Mark

-Fred

Mark Sciabica a écrit :
> Hi Robert,
>
> A look at the declaration of _appMouseCursor gives us a hint as to the
> original purpose of this code:
>
>   /// Persist which mouse cursor was used before switching to the
> resize cursors.
>   MouseCursor     _appMouseCursor;
>
> However, the code is not currently functioning as intended by the
> comment. In order to get it working that way, the WM_NCHITTEST message
> handler needs to change its handling of the "default:" switch case to
> use _appMouseCursor instead of LeftArrowCursor.
>
>   default:
>     if (_traits->useCursor && _appMouseCursor != InheritCursor)
>       setCursor(_appMouseCursor);
>     break;
>
> This will enable the code to remember the cursor set by the user and
> temporarily use the sizing cursors when appropriate. (Instead of
> forcing use of the LeftArrowCursor.) However, it still has the problem
> that the user can't manually use the sizing cursors correctly since
> they are never assigned to _appMouseCursor.
>
> A complete fix would also create a private version of setCursor that
> does not set _appMouseCursor while the public version sets
> _appMouseCursor and calls the private version. The WM_NCHITTEST
> handler would use the private version. I attached files implementing
> this proposed solution.
>
> Regards,
>
> Mark
>
> Robert Osfield wrote:
>> Hi Frederic + Windows users (Paul Martz/J.S?)
>>
>> I'm not familiar with the GraphicsWindowWin32.cpp, as I don't use
>> Windows nor been involved in writing the GraphicsWindowWin32.cpp so I
>> have to defer entirely to Windows volunteers to write and maintain
>> this particular chunk of code.
>>
>> I quite simply don't understand the motivation by the original codes
>> that do something different for the LeftRightCursor etc in
>> GraphicsWindowWin32:setCursor.   Since I don't understand why it's
>> there I cannot make a judgement call on whether it's appropriate to
>> remove it.  If I do merge your change then there is a good chance that
>> it'll fix things for you but breaks things for others.  There *must*
>> have been a reason that the code is there.
>>
>> Could I have some feedback from Win32 expects about the following bit
>> of code that Frederic has replaced in
>> GraphicsWindowWin32::setCursor().
>>
>> Original:
>>
>> In file "/home/robert/OpenSceneGraph/src/osgViewer//GraphicsWindowWin32.cpp":
>> ------------------------------
>> 1945:         if (mouseCursor != LeftRightCursor &&
>> 1946:             mouseCursor != UpDownCursor &&
>> 1947:             mouseCursor != TopLeftCorner &&
>> 1948:             mouseCursor != TopRightCorner &&
>> 1949:             mouseCursor != BottomLeftCorner &&
>> 1950:             mouseCursor != BottomRightCorner)
>> 1951:         {
>> 1952:             _appMouseCursor = mouseCursor;
>> 1953:         }
>> 1954:
>>
>> Fredric's version
>>
>> In file "GraphicsWindowWin32.cpp":
>> ------------------------------
>> 1945:         _appMouseCursor = mouseCursor;
>>
>>
>> Thanks for your insights,
>> Robert.
>>
>>
>>
>> On Thu, Apr 23, 2009 at 8:08 PM, Frederic Bouvier <[email protected]> wrote:
>>   
>>> Hi Robert,
>>>
>>> the patch attached, made from r10068, fix two things, in other of 
>>> importance :
>>>
>>> - the selected cursor is never shown ( second change in file ). Only the 
>>> left arrow is always displayed.
>>> - remove the arbitrary ( in my sense ) limitation that the user cannot 
>>> choose a cursor with the same shape that one used when resizing the window. 
>>> This limitation doesn't exist for X11, and we have a diverging behaviour 
>>> there ( first change in file ). Flightgear use the LeftRightCursor in look 
>>> around mode.
>>>
>>> Thank you very much
>>>
>>> Regards,
>>> -Fred
>>> Flightgear developer
>>>
>>>       


-- 
Frédéric Bouvier
http://my.fotolia.com/frfoto/   Photo gallery
http://fgsd.sourceforge.net/    FlightGear Scenery Designer

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

Reply via email to