qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v4 1/2] ui/cocoa: capture all keys and combos when mouse is g


From: Akihiko Odaki
Subject: Re: [PATCH v4 1/2] ui/cocoa: capture all keys and combos when mouse is grabbed
Date: Wed, 16 Jun 2021 23:13:04 +0900

2021年5月12日(水) 3:56 <gustavo@noronha.eti.br>:
> @@ -1877,11 +1934,17 @@ static void cocoa_display_init(DisplayState *ds, 
> DisplayOptions *opts)
>      qemu_sem_wait(&app_started_sem);
>      COCOA_DEBUG("cocoa_display_init: app start completed\n");
>
> +    QemuCocoaAppController* controller = (QemuCocoaAppController 
> *)[NSApplication sharedApplication];
>      /* if fullscreen mode is to be used */
>      if (opts->has_full_screen && opts->full_screen) {
>          dispatch_async(dispatch_get_main_queue(), ^{
>              [NSApp activateIgnoringOtherApps: YES];
> -            [(QemuCocoaAppController *)[[NSApplication sharedApplication] 
> delegate] toggleFullScreen: nil];
> +            [[controller delegate] toggleFullScreen: nil];
> +        });
> +    }
> +    if (opts->u.cocoa.has_full_grab && opts->u.cocoa.full_grab) {
> +        dispatch_async(dispatch_get_main_queue(), ^{
> +            [[controller delegate] setFullGrab: nil];
>          });
>      }
>      if (opts->has_show_cursor && opts->show_cursor) {
> --
> 2.30.1 (Apple Git-130)
>

Hi,

I found a problem which I didn't notice when I reviewed this patch
before. [NSApplication sharedApplication] is casted to
QemuCocoaAppController *, but its type is QemuApplication. Perhaps it
should be:
QemuCocoaAppController* controller = (QemuCocoaAppController
*)[[NSApplication sharedApplication] delegate];
and the following [controller delegate] should be replaced with controller.

Regards,
Akihiko Odaki



reply via email to

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