2021年5月12日(水) 3:56 <gust...@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