summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2015-07-17 09:16:10 -0500
committerJonathon Jongsma <jjongsma@redhat.com>2015-09-08 15:14:35 -0500
commit344eb9a68595ee26627e27fe733ac7789fdbdbb1 (patch)
treebaf660be3c364cad7391175579b2d6cf00378bc2
parent6413b645ffad03718608105b8245fc53f0229ffa (diff)
downloadvirt-viewer-344eb9a68595ee26627e27fe733ac7789fdbdbb1.tar.gz
virt-viewer-344eb9a68595ee26627e27fe733ac7789fdbdbb1.tar.xz
virt-viewer-344eb9a68595ee26627e27fe733ac7789fdbdbb1.zip
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.
-rw-r--r--src/virt-viewer-session-spice.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index 1649a62..988fc5b 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -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);