Hide extra monitors that don't fit in auto-conf

Virt-viewer sometimes opens one too many windows if the guest is
configured with more monitors than the client (the spice monitor
configuration request and the current config aren't related, so there is
some race). Instead, let's hide extra monitors that wouldn't fit in
auto-conf.

https://bugzilla.redhat.com/show_bug.cgi?id=985898
This commit is contained in:
Marc-André Lureau 2013-07-18 20:16:46 +02:00
parent 00d523bdf8
commit e46a4d6759

View File

@ -685,7 +685,10 @@ display_show_hint(VirtViewerDisplay *display,
"show-hint", &hint,
NULL);
if (hint & VIRT_VIEWER_DISPLAY_SHOW_HINT_DISABLED) {
if (self->priv->fullscreen_auto_conf &&
nth >= gdk_screen_get_n_monitors(gdk_screen_get_default())) {
virt_viewer_window_hide(win);
} else if (hint & VIRT_VIEWER_DISPLAY_SHOW_HINT_DISABLED) {
virt_viewer_window_hide(win);
} else if (hint & VIRT_VIEWER_DISPLAY_SHOW_HINT_READY) {
virt_viewer_notebook_show_display(nb);