[virt-tools-list] [PATCH virt-viewer 1/2] fullscreen-auto-conf: Do not enable display without monitor

Pavel Grunt pgrunt at redhat.com
Wed Jun 3 12:44:33 UTC 2015


Avoid enabling the display having 0x0 resolution.
---
 src/virt-viewer-session-spice.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index f763975..9c72245 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -870,13 +870,14 @@ virt_viewer_session_spice_fullscreen_auto_conf(VirtViewerSessionSpice *self)
     g_debug("Performing full screen auto-conf, %u host monitors", ndisplays);
     displays = g_new0(GdkRectangle, ndisplays);
 
-    for (i = 0, l = initial_displays; l != NULL; l = l->next, i++) {
-        GdkRectangle* rect = &displays[i];
+    for (ndisplays = 0, l = initial_displays; l != NULL; l = l->next) {
+        GdkRectangle* rect = &displays[ndisplays];
         gint j = virt_viewer_app_get_initial_monitor_for_display(app, GPOINTER_TO_INT(l->data));
         if (j == -1)
             continue;
 
         gdk_screen_get_monitor_geometry(screen, j, rect);
+        ndisplays++;
     }
     g_list_free(initial_displays);
 
-- 
2.4.2




More information about the virt-tools-list mailing list