Set enabled status of all displays when we get a monitor update

Previously, when we received a new monitors update from the server, we
only called virt_viewer_display_set_enabled() for the displays that were
enabled. We simply assumed that those that were not enabled were already
set to disabled. This assumption is currently valid, but I have some
changes in the pipeline where this is not true. This change ensures that
we update the enabled state of all monitors when we get an updated
monitors conifguration.
This commit is contained in:
Jonathon Jongsma 2015-07-17 09:16:10 -05:00
parent 6413b645ff
commit 344eb9a685

View File

@ -806,13 +806,15 @@ virt_viewer_session_spice_display_monitors(SpiceChannel *channel,
for (i = 0; i < monitors->len; i++) {
SpiceDisplayMonitorConfig *monitor = &g_array_index(monitors, SpiceDisplayMonitorConfig, i);
gboolean disabled = monitor->width == 0 || monitor->height == 0;
display = g_ptr_array_index(displays, monitor->id);
g_return_if_fail(display != NULL);
if (monitor->width == 0 || monitor->height == 0)
virt_viewer_display_set_enabled(VIRT_VIEWER_DISPLAY(display), !disabled);
if (disabled)
continue;
virt_viewer_display_set_enabled(VIRT_VIEWER_DISPLAY(display), TRUE);
virt_viewer_display_spice_set_desktop(VIRT_VIEWER_DISPLAY(display),
monitor->x, monitor->y,
monitor->width, monitor->height);