summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2014-06-20 14:39:12 -0500
committerJonathon Jongsma <jjongsma@redhat.com>2014-06-23 13:26:53 -0500
commiteaaa4f5106a9707e4b9a9cd7b52accde3459333d (patch)
tree4f3d5ec86538322d37ef1201ad933eae927d8efa
parent28a6bd6cf40aed40adf0763468ffe82e653369dc (diff)
downloadvirt-viewer-eaaa4f5106a9707e4b9a9cd7b52accde3459333d.tar.gz
virt-viewer-eaaa4f5106a9707e4b9a9cd7b52accde3459333d.tar.xz
virt-viewer-eaaa4f5106a9707e4b9a9cd7b52accde3459333d.zip
rhbz#1111514: Fix un-shrinkable displays on windows guests
Commit 6edde5786 introduced a regression wrt shrinking windows on windows guests. This seems to be because resizing a display often causes the notebook widget to switch to the status page temporarily (often so quickly that it's not noticeable to the eye). This causes a quick 'unmap' and 'map' event sequence on the display widget. Apparently the timing of these events varies enough between linux and windows guests that it is only noticeable on windows gueststhe timing of these events varies enough between linux and windows guests that it is only noticeable on windows guests. The exact sequence that causes the bug appears to be as follows: 1 user resizes window smaller 2 display widget gets a new allocation, which causes it to send a display reconfiguration to the guest 3 client receives a new show-hint for the display which causes it to switch temporarily to the 'status' notebook page 4 display widget gets unmapped 5 Client receives another new show-hint, which causes the display widget to get re- mapped, which causes client to send a display reconfiguration to the guest (using the old size) 6 client receives new (smaller, from step 2) display size and temporarily changes to the new size 7 client receives new (larger, from step 5) display size and changes back to original size. To fix the issue, we only explicitly request a resize in response to the very first map event, and for any subsequent map events, we simply call _make_resizable() as before.
-rw-r--r--src/virt-viewer-display.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/virt-viewer-display.c b/src/virt-viewer-display.c
index c5170c4..e91450f 100644
--- a/src/virt-viewer-display.c
+++ b/src/virt-viewer-display.c
@@ -38,6 +38,7 @@ struct _VirtViewerDisplayPrivate
{
#if !GTK_CHECK_VERSION(3, 0, 0)
gboolean dirty;
+ gboolean mapped_once;
#endif
guint desktopWidth;
guint desktopHeight;
@@ -452,9 +453,16 @@ virt_viewer_display_make_resizable(VirtViewerDisplay *self)
static void
virt_viewer_display_map(GtkWidget *widget)
{
+ VirtViewerDisplay* self = VIRT_VIEWER_DISPLAY(widget);
+
GTK_WIDGET_CLASS(virt_viewer_display_parent_class)->map(widget);
- virt_viewer_display_queue_resize(VIRT_VIEWER_DISPLAY(widget));
+ if (!self->priv->mapped_once)
+ virt_viewer_display_queue_resize(self);
+ else
+ virt_viewer_display_make_resizable(self);
+
+ self->priv->mapped_once = TRUE;
}
#else