Commit a6e0344f authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180220-pull-request' into staging



ui: reorganize and cleanup display command line parsing.
gtk: fix gtk3 warnings.

# gpg: Signature made Tue 20 Feb 2018 13:46:53 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20180220-pull-request:
  ui: Reorder vte terminal packing to avoid gtk3 warnings
  vl: drop display_type variable
  vl: drop request_opengl variable
  vl: drop full_screen variable
  cocoa: use DisplayOptions
  curses: use DisplayOptions
  egl-headless: use DisplayOptions
  vl: drop no_quit variable
  sdl: use DisplayOptions
  gtk: add and use DisplayOptions + DisplayGTK
  vl: rename DisplayType to LegacyDisplayType
  vl: deprecate -no-frame

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents b487e2b2 63ad9325
Loading
Loading
Loading
Loading
+13 −14
Original line number Diff line number Diff line
@@ -431,16 +431,16 @@ void surface_gl_setup_viewport(QemuGLShader *gls,

/* sdl.c */
#ifdef CONFIG_SDL
void sdl_display_early_init(int opengl);
void sdl_display_init(DisplayState *ds, int full_screen);
void sdl_display_early_init(DisplayOptions *opts);
void sdl_display_init(DisplayState *ds, DisplayOptions *opts);
#else
static inline void sdl_display_early_init(int opengl)
static inline void sdl_display_early_init(DisplayOptions *opts)
{
    /* This must never be called if CONFIG_SDL is disabled */
    error_report("SDL support is disabled");
    abort();
}
static inline void sdl_display_init(DisplayState *ds, int full_screen)
static inline void sdl_display_init(DisplayState *ds, DisplayOptions *opts)
{
    /* This must never be called if CONFIG_SDL is disabled */
    error_report("SDL support is disabled");
@@ -450,9 +450,9 @@ static inline void sdl_display_init(DisplayState *ds, int full_screen)

/* 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");
@@ -471,9 +471,9 @@ int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp);

/* curses.c */
#ifdef CONFIG_CURSES
void curses_display_init(DisplayState *ds, int full_screen);
void curses_display_init(DisplayState *ds, DisplayOptions *opts);
#else
static inline void curses_display_init(DisplayState *ds, int full_screen)
static inline void curses_display_init(DisplayState *ds, DisplayOptions *opts)
{
    /* This must never be called if CONFIG_CURSES is disabled */
    error_report("curses support is disabled");
@@ -486,18 +486,17 @@ int index_from_key(const char *key, size_t key_length);

/* gtk.c */
#ifdef CONFIG_GTK
void early_gtk_display_init(int opengl);
void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover);
void early_gtk_display_init(DisplayOptions *opts);
void gtk_display_init(DisplayState *ds, DisplayOptions *opts);
#else
static inline void gtk_display_init(DisplayState *ds, bool full_screen,
                                    bool grab_on_hover)
static inline void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
{
    /* This must never be called if CONFIG_GTK is disabled */
    error_report("GTK support is disabled");
    abort();
}

static inline void early_gtk_display_init(int opengl)
static inline void early_gtk_display_init(DisplayOptions *opts)
{
    /* This must never be called if CONFIG_GTK is disabled */
    error_report("GTK support is disabled");
@@ -506,6 +505,6 @@ static inline void early_gtk_display_init(int opengl)
#endif

/* egl-headless.c */
void egl_headless_init(void);
void egl_headless_init(DisplayOptions *opts);

#endif
+64 −0
Original line number Diff line number Diff line
@@ -985,3 +985,67 @@
  'data': { '*device': 'str',
            '*head'  : 'int',
            'events' : [ 'InputEvent' ] } }


##
# @DisplayNoOpts:
#
# Empty struct for displays without config options.
#
# Since: 2.12
#
##
{ 'struct'  : 'DisplayNoOpts',
  'data'    : { } }

##
# @DisplayGTK:
#
# GTK display options.
#
# @grab-on-hover: Grab keyboard input on mouse hover.
#
# Since: 2.12
#
##
{ 'struct'  : 'DisplayGTK',
  'data'    : { '*grab-on-hover' : 'bool' } }

##
# @DisplayType:
#
# Display (user interface) type.
#
# Since: 2.12
#
##
{ 'enum'    : 'DisplayType',
  'data'    : [ 'default', 'none', 'gtk', 'sdl',
                'egl-headless', 'curses', 'cocoa' ] }

##
# @DisplayOptions:
#
# Display (user interface) options.
#
# @type:          Which DisplayType qemu should use.
# @full-screen:   Start user interface in fullscreen mode (default: off).
# @window-close:  Allow to quit qemu with window close button (default: on).
# @gl:            Enable OpenGL support (default: off).
#
# Since: 2.12
#
##
{ 'union'   : 'DisplayOptions',
  'base'    : { 'type'           : 'DisplayType',
                '*full-screen'   : 'bool',
                '*window-close'  : 'bool',
                '*gl'            : 'bool' },
  'discriminator' : 'type',
  'data'    : { 'default'        : 'DisplayNoOpts',
                'none'           : 'DisplayNoOpts',
                'gtk'            : 'DisplayGTK',
                'sdl'            : 'DisplayNoOpts',
                'egl-headless'   : 'DisplayNoOpts',
                'curses'         : 'DisplayNoOpts',
                'cocoa'          : 'DisplayNoOpts' } }
+7 −0
Original line number Diff line number Diff line
@@ -2741,6 +2741,13 @@ filesystem test suite. Also it requires the CAP_DAC_READ_SEARCH capability,
which is not the recommended way to run QEMU. This backend should not be
used and it will be removed with no replacement.

@subsection -no-frame (since 2.12.0)

The ``-no-frame'' argument works with SDL 1.2 only.  SDL 2.0 lacks
support for frameless windows, and the other user interfaces never
implemented this in the first place.  So this will be removed together
with SDL 1.2 support.

@section qemu-img command line arguments

@subsection convert -s (since 2.0.0)
+2 −2
Original line number Diff line number Diff line
@@ -1683,12 +1683,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->has_full_screen && opts->full_screen) {
        [NSApp activateIgnoringOtherApps: YES];
        [(QemuCocoaAppController *)[[NSApplication sharedApplication] delegate] toggleFullScreen: nil];
    }
+1 −1
Original line number Diff line number Diff line
@@ -434,7 +434,7 @@ static const DisplayChangeListenerOps dcl_ops = {
    .dpy_text_cursor = curses_cursor_position,
};

void curses_display_init(DisplayState *ds, int full_screen)
void curses_display_init(DisplayState *ds, DisplayOptions *opts)
{
#ifndef _WIN32
    if (!isatty(1)) {
Loading