qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Roman Bolshakov <r.bolshakov@yadro.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, patches@linaro.org,
	John Arbuckle <programmingkidx@gmail.com>,
	Berkus Decker <berkus@gmail.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Ben Hekster <ben.hekster@foghorn.io>,
	BALATON Zoltan <balaton@eik.bme.hu>
Subject: Re: [Qemu-devel] [PATCH v2 5/7] ui/cocoa: Don't call NSApp sendEvent directly from handleEvent
Date: Fri, 22 Feb 2019 22:20:39 +0300	[thread overview]
Message-ID: <20190222192039.37fbm3aelhtesq3e@SPB-NB-133.local> (raw)
In-Reply-To: <20190214102816.3393-6-peter.maydell@linaro.org>

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 <balaton@eik.bme.hu>
> Signed-off-by: Peter Maydell <peter.maydell@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.bolshakov@yadro.com>
Tested-by: Roman Bolshakov <r.bolshakov@yadro.com>

Thanks,
Roman

  parent reply	other threads:[~2019-02-22 19:20 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 10:28 [Qemu-devel] [PATCH v2 0/7] ui/cocoa: Use OSX's main loop Peter Maydell
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 1/7] ui/cocoa: Ensure we have the iothread lock when calling into QEMU Peter Maydell
2019-02-22 15:19   ` Roman Bolshakov
2019-02-22 15:41     ` Peter Maydell
2019-02-22 21:48       ` Roman Bolshakov
2019-02-23 13:11         ` Peter Maydell
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 2/7] ui/cocoa: Use the pixman image directly in switchSurface Peter Maydell
2019-02-14 17:19   ` BALATON Zoltan
2019-02-22 17:27   ` Roman Bolshakov
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 3/7] ui/cocoa: Factor out initial menu creation Peter Maydell
2019-02-14 17:11   ` BALATON Zoltan
2019-02-22 17:47   ` Roman Bolshakov
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 4/7] ui/cocoa: Move console/device menu creation code up in file Peter Maydell
2019-02-15  0:34   ` BALATON Zoltan
2019-02-22 18:10   ` Roman Bolshakov
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 5/7] ui/cocoa: Don't call NSApp sendEvent directly from handleEvent Peter Maydell
2019-02-14 17:04   ` BALATON Zoltan
2019-02-14 17:41     ` Peter Maydell
2019-02-15  0:42       ` BALATON Zoltan
2019-02-22 19:20   ` Roman Bolshakov [this message]
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 6/7] ui/cocoa: Subclass NSApplication so we can implement sendEvent Peter Maydell
2019-02-14 17:21   ` BALATON Zoltan
2019-02-22 20:18   ` Roman Bolshakov
2019-02-14 10:28 ` [Qemu-devel] [PATCH v2 7/7] ui/cocoa: Perform UI operations only on the main thread Peter Maydell
2019-02-15  0:55   ` BALATON Zoltan
2019-02-15  1:28   ` BALATON Zoltan
2019-02-15 10:04     ` Peter Maydell
2019-02-16  1:15       ` BALATON Zoltan
2019-02-22 21:35   ` Roman Bolshakov
2019-02-14 11:07 ` [Qemu-devel] [PATCH v2 0/7] ui/cocoa: Use OSX's main loop no-reply
2019-02-14 11:11 ` no-reply
2019-02-14 17:44 ` no-reply
2019-02-14 17:48 ` no-reply
2019-02-14 17:52 ` no-reply
2019-02-15  1:01 ` no-reply
2019-02-27 15:24 ` no-reply
2019-02-27 15:29 ` no-reply
2019-02-27 17:41 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190222192039.37fbm3aelhtesq3e@SPB-NB-133.local \
    --to=r.bolshakov@yadro.com \
    --cc=balaton@eik.bme.hu \
    --cc=ben.hekster@foghorn.io \
    --cc=berkus@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).