summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2015-07-16 11:30:27 -0500
committerJonathon Jongsma <jjongsma@redhat.com>2015-09-08 15:14:35 -0500
commit6413b645ffad03718608105b8245fc53f0229ffa (patch)
tree830971444decb7d304f4f7f282e1c6f6e3bc6e8c
parent5001f2b1b155f4279a3e942b9bbf97f9d489a90a (diff)
downloadvirt-viewer-6413b645ffad03718608105b8245fc53f0229ffa.tar.gz
virt-viewer-6413b645ffad03718608105b8245fc53f0229ffa.tar.xz
virt-viewer-6413b645ffad03718608105b8245fc53f0229ffa.zip
Don't emit 'monitor-geometry-changed' for disabled displays
When a display widget receives a new size allocation, we generally emit a monitor-geometry-changed signal so that we can reconfigure the displays. But if the widget for a *disabled* display is allocated, there's no reason to send down a new configuration. We don't need to emit this signal. This doesn't currently cause any problems, but I ran into issues while testing some other uncommitted changes.
-rw-r--r--src/virt-viewer-display-spice.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/src/virt-viewer-display-spice.c b/src/virt-viewer-display-spice.c
index 399c207..f5e66a2 100644
--- a/src/virt-viewer-display-spice.c
+++ b/src/virt-viewer-display-spice.c
@@ -178,26 +178,25 @@ virt_viewer_display_spice_size_allocate(VirtViewerDisplaySpice *self,
gpointer data G_GNUC_UNUSED)
{
GtkRequisition preferred;
- 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
- */
- virt_viewer_display_get_preferred_size(VIRT_VIEWER_DISPLAY(self), &preferred);
- if (preferred.width == allocation->width
- && preferred.height == allocation->height) {
- return;
- }
+
+ if (!virt_viewer_display_get_enabled(VIRT_VIEWER_DISPLAY(self)))
+ return;
+
+ /* 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
+ */
+ virt_viewer_display_get_preferred_size(VIRT_VIEWER_DISPLAY(self), &preferred);
+ if (preferred.width == allocation->width
+ && preferred.height == allocation->height) {
+ return;
}
if (self->priv->auto_resize != AUTO_RESIZE_NEVER)