On Thu, Feb 14, 2019 at 10:28:14AM +0000, Peter Maydell wrote:
> Currently the handleEvent method will directly call the NSApp
> sendEvent method for any events that we want to let OSX deal
> with. When we rearrange the event handling code, the way that
> we say "let OSX have this event" is going to change. Prepare
> for that by refactoring so that handleEvent returns a flag
> indicating whether it consumed the event.
> 
> Suggested-by: BALATON Zoltan <bala...@eik.bme.hu>
> Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
> ---
> New patch in v2
> ---
>  ui/cocoa.m | 49 ++++++++++++++++++++++++++++++++++---------------
>  1 file changed, 34 insertions(+), 15 deletions(-)
> 
> @@ -1749,7 +1766,9 @@ static void cocoa_refresh(DisplayChangeListener *dcl)
>          event = [NSApp nextEventMatchingMask:NSEventMaskAny 
> untilDate:distantPast
>                          inMode: NSDefaultRunLoopMode dequeue:YES];
>          if (event != nil) {
> -            [cocoaView handleEvent:event];
> +            if (![cocoaView handleEvent:event]) {
> +                [NSApp sendEvent:event];
> +            }
>          }
>      } while(event != nil);
>      [pool release];
> -- 
> 2.17.2 (Apple Git-113)
> 

I like the patch. It makes clear that cocoa_refresh performs the work
of [NSApp run].

Besides the trailing whitespace issue,

Reviewed-by: Roman Bolshakov <r.bolsha...@yadro.com>
Tested-by: Roman Bolshakov <r.bolsha...@yadro.com>

Thanks,
Roman

Reply via email to