Re: [PATCH virt-viewer 1/3] spice: factor out spice resize code from gtk signal handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks good, ack-series.

On 07/23/2013 04:31 PM, Marc-André Lureau wrote:
This will allow that part of the code to be called with a different
resize-guest setting.
---
  src/virt-viewer-display-spice.c | 18 ++++++++++++++----
  1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/virt-viewer-display-spice.c b/src/virt-viewer-display-spice.c
index 5eb22cf..00fcfae 100644
--- a/src/virt-viewer-display-spice.c
+++ b/src/virt-viewer-display-spice.c
@@ -181,9 +181,9 @@ virt_viewer_display_spice_mouse_grab(SpiceDisplay *display G_GNUC_UNUSED,


  static void
-virt_viewer_display_spice_size_allocate(VirtViewerDisplaySpice *self,
-                                        GtkAllocation *allocation,
-                                        gpointer data G_GNUC_UNUSED)
+virt_viewer_display_spice_resize(VirtViewerDisplaySpice *self,
+                                 GtkAllocation *allocation,
+                                 gboolean resize_guest)
  {
      gdouble dw = allocation->width, dh = allocation->height;
      guint zoom = 100;
@@ -228,7 +228,7 @@ virt_viewer_display_spice_size_allocate(VirtViewerDisplaySpice *self,

      g_object_get(self, "nth-display", &nth, NULL);

-    if (self->priv->auto_resize != AUTO_RESIZE_NEVER) {
+    if (resize_guest) {
          g_object_set(get_main(VIRT_VIEWER_DISPLAY(self)),
                       "disable-display-position", disable_display_position,
                       "disable-display-align", !disable_display_position,
@@ -236,6 +236,16 @@ virt_viewer_display_spice_size_allocate(VirtViewerDisplaySpice *self,
          spice_main_set_display(get_main(VIRT_VIEWER_DISPLAY(self)),
                                 nth, x, y, dw, dh);
      }
+}
+
+static void
+virt_viewer_display_spice_size_allocate(VirtViewerDisplaySpice *self,
+                                        GtkAllocation *allocation,
+                                        gpointer data G_GNUC_UNUSED)
+{
+    virt_viewer_display_spice_resize(self, allocation,
+                                     self->priv->auto_resize != AUTO_RESIZE_NEVER);
+
      if (self->priv->auto_resize == AUTO_RESIZE_FULLSCREEN)
          self->priv->auto_resize = AUTO_RESIZE_NEVER;
  }


_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list





[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux