summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-session-spice.c
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2014-09-22 14:08:30 -0500
committerJonathon Jongsma <jjongsma@redhat.com>2014-09-24 10:19:29 -0500
commitf26a5fe16cc5d71a3edad17026ab35411286b140 (patch)
tree4e33ad78b7b1b4dfb8eefaa5927201425e94471a /src/virt-viewer-session-spice.c
parentf317e950969738783919ea7d7f3a2fa9ddd44c3b (diff)
downloadvirt-viewer-f26a5fe16cc5d71a3edad17026ab35411286b140.tar.gz
virt-viewer-f26a5fe16cc5d71a3edad17026ab35411286b140.tar.xz
virt-viewer-f26a5fe16cc5d71a3edad17026ab35411286b140.zip
Don't show extra screens in fullscreen mode
When using the fullscreen display mapping configuration file, extra monitors could end up enabled by mistake. This was because virt_viewer_app_get_initial_monitor_for_display would end up returning Nmonitor = Ndisplay when the display map hash lookup failed. In reality, when a display map is specified, but the hash lookup fails, the display should not be enabled. This function now returns -1 to distinguish this case, and the display is not enabled when this value is returned. Resolves issue described at https://bugzilla.redhat.com/show_bug.cgi?id=1129477#c9
Diffstat (limited to 'src/virt-viewer-session-spice.c')
-rw-r--r--src/virt-viewer-session-spice.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index 2323832..b856e78 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -807,6 +807,9 @@ virt_viewer_session_spice_fullscreen_auto_conf(VirtViewerSessionSpice *self)
for (i = 0; i < ndisplays; i++) {
gint j = virt_viewer_app_get_initial_monitor_for_display(app, i);
+ if (j == -1)
+ continue;
+
gdk_screen_get_monitor_geometry(screen, j, &dest);
g_debug("Set SPICE display %d to (%d,%d)-(%dx%d)",
i, dest.x, dest.y, dest.width, dest.height);