All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>, Eric Blake <eblake@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH 10/24] cocoa: use DisplayOptions
Date: Fri, 17 Nov 2017 11:30:32 +0100	[thread overview]
Message-ID: <20171117103046.15943-11-kraxel@redhat.com> (raw)
In-Reply-To: <20171117103046.15943-1-kraxel@redhat.com>

Switch cocoa ui to use qapi DisplayOptions for configuration.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/ui/console.h | 4 ++--
 vl.c                 | 3 ++-
 qapi/ui.json         | 6 ++++--
 ui/cocoa.m           | 4 ++--
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index 9749503aa7..f96fd907d0 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -454,9 +454,9 @@ static inline void sdl_display_init(DisplayState *ds, DisplayOptions *opts)
 
 /* cocoa.m */
 #ifdef CONFIG_COCOA
-void cocoa_display_init(DisplayState *ds, int full_screen);
+void cocoa_display_init(DisplayState *ds, DisplayOptions *opts);
 #else
-static inline void cocoa_display_init(DisplayState *ds, int full_screen)
+static inline void cocoa_display_init(DisplayState *ds, DisplayOptions *opts)
 {
     /* This must never be called if CONFIG_COCOA is disabled */
     error_report("Cocoa support is disabled");
diff --git a/vl.c b/vl.c
index b1036626eb..7d7e4ba9a1 100644
--- a/vl.c
+++ b/vl.c
@@ -4465,6 +4465,7 @@ int main(int argc, char **argv, char **envp)
         dpy.type = DISPLAY_TYPE_SDL;
 #elif defined(CONFIG_COCOA)
         display_type = DT_COCOA;
+        dpy.type = DISPLAY_TYPE_COCOA;
 #elif defined(CONFIG_VNC)
         vnc_parse("localhost:0,to=99,id=default", &error_abort);
 #else
@@ -4824,7 +4825,7 @@ int main(int argc, char **argv, char **envp)
         sdl_display_init(ds, &dpy);
         break;
     case DT_COCOA:
-        cocoa_display_init(ds, full_screen);
+        cocoa_display_init(ds, &dpy);
         break;
     case DT_GTK:
         gtk_display_init(ds, &dpy);
diff --git a/qapi/ui.json b/qapi/ui.json
index 4bb3f938f1..2baa5127cf 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1009,7 +1009,8 @@
 #
 ##
 { 'enum'    : 'DisplayType',
-  'data'    : [ 'default', 'none', 'gtk', 'sdl', 'egl-headless', 'curses' ] }
+  'data'    : [ 'default', 'none', 'gtk', 'sdl',
+                'egl-headless', 'curses', 'cocoa' ] }
 
 ##
 # @DisplayOptions:
@@ -1028,4 +1029,5 @@
                 'gtk'            : 'DisplayGTK',
                 'sdl'            : 'DisplayNoOpts',
                 'egl-headless'   : 'DisplayNoOpts',
-                'curses'         : 'DisplayNoOpts' } }
+                'curses'         : 'DisplayNoOpts',
+                'cocoa'          : 'DisplayNoOpts' } }
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 330ccebf90..9560c07105 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1671,12 +1671,12 @@ static void addRemovableDevicesMenuItems(void)
     qapi_free_BlockInfoList(pointerToFree);
 }
 
-void cocoa_display_init(DisplayState *ds, int full_screen)
+void cocoa_display_init(DisplayState *ds, DisplayOptions *opts)
 {
     COCOA_DEBUG("qemu_cocoa: cocoa_display_init\n");
 
     /* if fullscreen mode is to be used */
-    if (full_screen == true) {
+    if (opts->have_full_screen && opts->full_screen) {
         [NSApp activateIgnoringOtherApps: YES];
         [(QemuCocoaAppController *)[[NSApplication sharedApplication] delegate] toggleFullScreen: nil];
     }
-- 
2.9.3

  parent reply	other threads:[~2017-11-17 10:31 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-17 10:30 [Qemu-devel] [PATCH 00/24] RfC: rework display initialization Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 01/24] sdl: remove -no-frame support Gerd Hoffmann
2017-11-17 14:21   ` Daniel P. Berrange
2017-11-17 14:49     ` Gerd Hoffmann
2017-11-17 14:59       ` Daniel P. Berrange
2017-11-17 15:06         ` Daniel P. Berrange
2017-11-17 10:30 ` [Qemu-devel] [PATCH 02/24] sdl: remove -alt-grab and -ctrl-grab support Gerd Hoffmann
2017-11-17 14:22   ` Daniel P. Berrange
2017-11-17 14:51     ` Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 03/24] sdl: use ctrl-alt-g as grab hotkey Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 04/24] vl: rename DisplayType to LegacyDisplayType Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 05/24] gtk: add and use DisplayOptions + DisplayGTK Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 06/24] sdl: use DisplayOptions Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 07/24] vl: drop no_quit variable Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 08/24] egl-headless: use DisplayOptions Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 09/24] curses: " Gerd Hoffmann
2017-11-17 10:30 ` Gerd Hoffmann [this message]
2017-11-17 10:30 ` [Qemu-devel] [PATCH 11/24] vl: drop full_screen variable Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 12/24] vl: drop display_type variable Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 13/24] vl: drop request_opengl variable Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 14/24] console: add qemu display registry, add gtk Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 15/24] sdl: hook up to display registry Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 16/24] cocoa: " Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 17/24] curses: " Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 18/24] egl-headless: " Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 19/24] console: add and use qemu_display_find_default Gerd Hoffmann
2017-11-17 12:55   ` Darren Kenny
2017-11-17 13:24     ` Gerd Hoffmann
2017-11-17 14:16       ` Darren Kenny
2017-11-17 15:03         ` Gerd Hoffmann
2017-11-17 15:55           ` Darren Kenny
2017-11-17 10:30 ` [Qemu-devel] [PATCH 20/24] console: add ui module loading support Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 21/24] sdl: build as module Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 22/24] gtk: " Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 23/24] curses: " Gerd Hoffmann
2017-11-17 10:30 ` [Qemu-devel] [PATCH 24/24] build: opengl should not need X11 Gerd Hoffmann
2017-11-17 10:58 ` [Qemu-devel] [PATCH 00/24] RfC: rework display initialization 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=20171117103046.15943-11-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.