Don't try to re-configure displays when there are none

virt_viewer_session_on_monitor_geometry_changed() gets called
immediately upon agent connection, but sometimes this is before any
displays have been received. Simply return early when this is the case.
This commit is contained in:
Jonathon Jongsma 2014-09-30 11:36:25 -05:00
parent 8fa5e004ec
commit f0d662994f

View File

@ -362,6 +362,9 @@ virt_viewer_session_on_monitor_geometry_changed(VirtViewerSession* self,
nmonitors = MAX(nth + 1, nmonitors);
}
if (nmonitors == 0)
return;
monitors = g_new0(GdkRectangle, nmonitors);
for (l = self->priv->displays; l; l = l->next) {
VirtViewerDisplay *d = VIRT_VIEWER_DISPLAY(l->data);