ui: some small fixes/improvements.

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJbsfoIAAoJEEy22O7T6HE4UzIQAIVt2AqqT1OS5o6nUoJDAE6C
 kfqPVCOkqVoY7EtNrh0wtv342JorZEYhjW9v3FRFWdXY0oopex8a5QHJMC4v4XLQ
 oiueITAs1jv4Qtor+LER4YlS429Hy7ln44tCgcpaUIYIopNrWogJRFn7DwG4xmHC
 T5XN/28QF3CI2Y52pV5gh785cwnCUkzeYor+NI6ya79KvAEl1lTv1uF9oECwxhjL
 jXi6fl3ek+ugSzUL0iKzt4GxsPuyElXryNkB6Ees1QWWk7W814GTD4bE0ND8JIn9
 zvcGCqTrPE4HNFlJa6cWFoNQ1090aKGR+AAZXoZh8HdsVOUd9BO5gBwrFhLFt6UF
 HRw44J3LALtxMQsGZkI35PM+wD9lA8OUrkkr9NrKVGhpyBC67RyqJiNVcH3TxbPk
 2TNVARAMIdFnpG6dRCBgezoFQOS6uS3XhJUt69pkwjsNWql4yy0VnaAqmyjVPK+B
 JrKcOLWkY3JIer4e2ZqLkhdWxWrBytjsbW62XBjHgOoJVi7hkeCyJ2VHk5gAyIit
 jlH69fNF4SiobBj1g/KKb6usI4HNYRgqF52KwPvNdYmLpY9F8RUg9p2nVWIjM7Z1
 zgH42ms9GUAGBr1l39Fm/mY9nQCAVoeXR9Yv+CLu/Jk5pX8wTFkOMW2fLs/dJZBx
 dcEHGMUY4ptkxcSto8bb
 =Ul2P
 -----END PGP SIGNATURE-----

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

ui: some small fixes/improvements.

# gpg: Signature made Mon 01 Oct 2018 11:42:16 BST
# 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-20181001-pull-request:
  gtk: add zoom-to-fit to gtk options.
  vnc: call sasl_server_init() only when required
  sdl2: show console #0 unconditionally

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2018-10-01 15:44:30 +01:00
commit a2ef4d9e95
4 changed files with 27 additions and 9 deletions

View File

@ -1022,12 +1022,20 @@
# GTK display options.
#
# @grab-on-hover: Grab keyboard input on mouse hover.
# @zoom-to-fit: Zoom guest display to fit into the host window. When
# turned off the host window will be resized instead.
# In case the display device can notify the guest on
# window resizes (virtio-gpu) this will default to "on",
# assuming the guest will resize the display to match
# the window size then. Otherwise it defaults to "off".
# Since 3.1
#
# Since: 2.12
#
##
{ 'struct' : 'DisplayGTK',
'data' : { '*grab-on-hover' : 'bool' } }
'data' : { '*grab-on-hover' : 'bool',
'*zoom-to-fit' : 'bool' } }
##
# @DisplayGLMode:

View File

@ -2136,6 +2136,8 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
QemuConsole *con, int idx,
GSList *group, GtkWidget *view_menu)
{
bool zoom_to_fit;
vc->label = qemu_console_get_label(con);
vc->s = s;
vc->gfx.scale_x = 1.0;
@ -2199,6 +2201,12 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
group = gd_vc_menu_init(s, vc, idx, group, view_menu);
if (dpy_ui_info_supported(vc->gfx.dcl.con)) {
zoom_to_fit = true;
}
if (s->opts->u.gtk.has_zoom_to_fit) {
zoom_to_fit = s->opts->u.gtk.zoom_to_fit;
}
if (zoom_to_fit) {
gtk_menu_item_activate(GTK_MENU_ITEM(s->zoom_fit_item));
s->free_scale = true;
}

View File

@ -806,7 +806,8 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
for (i = 0; i < sdl2_num_outputs; i++) {
QemuConsole *con = qemu_console_lookup_by_index(i);
assert(con != NULL);
if (!qemu_console_is_graphic(con)) {
if (!qemu_console_is_graphic(con) &&
qemu_console_get_index(con) != 0) {
sdl2_console[i].hidden = true;
}
sdl2_console[i].idx = i;

View File

@ -3821,9 +3821,6 @@ void vnc_display_open(const char *id, Error **errp)
bool reverse = false;
const char *credid;
bool sasl = false;
#ifdef CONFIG_VNC_SASL
int saslErr;
#endif
int acl = 0;
int lock_key_sync = 1;
int key_delay_ms;
@ -3963,10 +3960,14 @@ void vnc_display_open(const char *id, Error **errp)
trace_vnc_auth_init(vd, 1, vd->ws_auth, vd->ws_subauth);
#ifdef CONFIG_VNC_SASL
if ((saslErr = sasl_server_init(NULL, "qemu")) != SASL_OK) {
error_setg(errp, "Failed to initialize SASL auth: %s",
sasl_errstring(saslErr, NULL, NULL));
goto fail;
if (sasl) {
int saslErr = sasl_server_init(NULL, "qemu");
if (saslErr != SASL_OK) {
error_setg(errp, "Failed to initialize SASL auth: %s",
sasl_errstring(saslErr, NULL, NULL));
goto fail;
}
}
#endif
vd->lock_key_sync = lock_key_sync;