summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-display-spice.c
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2014-03-14 15:35:04 -0500
committerJonathon Jongsma <jjongsma@redhat.com>2014-03-27 09:43:00 -0500
commitf1cadccb9a765932fc338f9330ef58d08f737101 (patch)
tree45e53c8ebc9d1d45ab83f38089c181baf4cee251 /src/virt-viewer-display-spice.c
parentb6d2744baeb468a1e394e8f9ab1a9c9c8d278842 (diff)
downloadvirt-viewer-f1cadccb9a765932fc338f9330ef58d08f737101.tar.gz
virt-viewer-f1cadccb9a765932fc338f9330ef58d08f737101.tar.xz
virt-viewer-f1cadccb9a765932fc338f9330ef58d08f737101.zip
Fix regression with enabling additional displays
Commit 8fa942 broke enabling of additional displays. We don't want to send down display re-configurations due to events that happen while setting up windows for enabled displays that we recieve from the server. However, by ignoring allocations on unmapped windows, we fail to send display configurations for new displays that a user is attempting to enable via the window menu. To discriminate between these two cases, we check whether the display is in the 'ready' state or not. - Unmapped displays with the 'ready' hint set can be assumed to be displays that are enabled on the server that we are attempting to create windows for on the client. In this case, we should *not* send a display configuration to the server - Unmapped displays with the 'ready' hint cleared can be assumed to be displays that are not yet enabled on the server that we are trying to enable in the client. In this case, we *should* send a display configuration to the server
Diffstat (limited to 'src/virt-viewer-display-spice.c')
-rw-r--r--src/virt-viewer-display-spice.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/virt-viewer-display-spice.c b/src/virt-viewer-display-spice.c
index c44dfcb..76dfb47 100644
--- a/src/virt-viewer-display-spice.c
+++ b/src/virt-viewer-display-spice.c
@@ -189,22 +189,26 @@ virt_viewer_display_spice_size_allocate(VirtViewerDisplaySpice *self,
gpointer data G_GNUC_UNUSED)
{
GtkRequisition preferred;
-
- /* ignore all allocations before the widget gets mapped to screen since we
- * only want to trigger guest resizing due to user actions
- */
- if (!gtk_widget_get_mapped(GTK_WIDGET(self)))
- return;
-
- /* when the window gets resized due to a change in zoom level, we don't want
- * to re-size the guest display. So if we get an allocation event that
- * resizes the window to the size it already wants to be (based on desktop
- * size and zoom level), just return early
- */
- gtk_widget_get_preferred_size(GTK_WIDGET(self), NULL, &preferred);
- if (preferred.width == allocation->width
- && preferred.height == allocation->height) {
- return;
+ guint hint = virt_viewer_display_get_show_hint(VIRT_VIEWER_DISPLAY(self));
+
+ if (hint & VIRT_VIEWER_DISPLAY_SHOW_HINT_READY)
+ {
+ /* ignore all allocations before the widget gets mapped to screen since we
+ * only want to trigger guest resizing due to user actions
+ */
+ if (!gtk_widget_get_mapped(GTK_WIDGET(self)))
+ return;
+
+ /* when the window gets resized due to a change in zoom level, we don't want
+ * to re-size the guest display. So if we get an allocation event that
+ * resizes the window to the size it already wants to be (based on desktop
+ * size and zoom level), just return early
+ */
+ gtk_widget_get_preferred_size(GTK_WIDGET(self), NULL, &preferred);
+ if (preferred.width == allocation->width
+ && preferred.height == allocation->height) {
+ return;
+ }
}
if (self->priv->auto_resize != AUTO_RESIZE_NEVER)