summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-app.c
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2015-03-04 23:40:37 +0100
committerFabiano FidĂȘncio <fidencio@redhat.com>2015-03-16 20:54:05 +0100
commit4de3379f34a693a3ec81cce4f0ed741213ba00cb (patch)
treec09c1ba1b1afd6b0ab286dba964a81703406e4ec /src/virt-viewer-app.c
parent1e63a400143f90be230a5c6b0c8cff31402624a7 (diff)
downloadvirt-viewer-4de3379f34a693a3ec81cce4f0ed741213ba00cb.tar.gz
virt-viewer-4de3379f34a693a3ec81cce4f0ed741213ba00cb.tar.xz
virt-viewer-4de3379f34a693a3ec81cce4f0ed741213ba00cb.zip
Update geometry when enabling/disabling displays
_update_displays_geometry() must be called every time a display is enabled/disabled, avoiding gaps (when a display is disabled) or overlaps (when a display is enabled) between the monitors. This is what happens when we have 3 displays enabled (each one represented by: width x height + x position + y position) ... Display #0 Display #1 Display #2 +---------+ +----------+ +---------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +---------+ +----------+ +---------+ (680x804+0+0) (504x804+680+0) (408x804+1184+0) Whether the Display #1 is disable, a message will be sent down to the vdagent, representing the new arrangement of the monitors: Display #0 Display #2 +---------+ +---------+ | | | | | | | | | | | | | | | | | | | | | | | | +---------+ +---------+ (680x804+0+0) (408x804+1184+0) However, taking a look on the x position, a gap can be identified as Display #0 starts at position (0,0) and has 680 pixels of width. But Display #1 only starts at position (1184, 0), leaving 504 pixels as a gap. The proper message, however, should represent the following arrangement ... Display #0 Display #2 +---------+ +---------+ | | | | | | | | | | | | | | | | | | | | | | | | +---------+ +---------+ (680x804+0+0) (408x804+680+0) ... avoiding then gaps and overlaps. Resolves: rhbz#1111425 https://bugzilla.redhat.com/show_bug.cgi?id=1111425
Diffstat (limited to 'src/virt-viewer-app.c')
-rw-r--r--src/virt-viewer-app.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 2af1b93..8bf728f 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -2180,6 +2180,8 @@ menu_display_visible_toggled_cb(GtkCheckMenuItem *checkmenuitem,
gtk_check_menu_item_set_active(checkmenuitem, /* will be toggled again */ !visible);
reentering = FALSE;
+
+ virt_viewer_session_update_displays_geometry(virt_viewer_display_get_session(display));
}
static gint