bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMenuView and mouse tracking. Test needed


From: Alexander Malmberg
Subject: Re: NSMenuView and mouse tracking. Test needed
Date: Fri, 18 Apr 2003 02:27:32 +0200

Willem Rein Oudshoorn wrote:
> 
> Serg Stoyan <stoyan@hologr.com> writes:
> 
> > There is another approach in improving speed and response - stop using
> > periodic events. I've tried to change NSMenuView's trackWithEvent: to act
> > that way, but menu appearing (sliding if it's partly off screen) stop
> > working properly.
> 
> I think this would be the best approach.  However some things do need timing:
> 
> - Scrolling/sliding the menu (as you noticed)
> - Opening and closing submenus, this is rather subtle and I am not going to
>   explain now.

The timing in these cases trigger certain "events" (scrolling one step,
etc.). Timing should not be used to (directly) trigger drawing; drawing
should happen as often as possible when necessary.

> But both can be achieved without using periodic events.
> 
> However I got the impression that the loop without periodic events
> in the NSMenuTitleView did not work properly for certain people.
> This should be investigated first before we try a similar change
> in the much more dificult "trackEvent" code in NSMenuView.

The failure is due to the backend not giving accurate mouse location
information when windows are moving, so any loop that doesn't move
windows should be ok. [NSWindow -mouseLocationOutsideOfEventStream]
seems to always return an accurate location, but calling it is
expensive, so that's just a workaround.

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]