[virt-tools-list] [PATCH virt-viewer 2/3] virt-viewer-window: Synchronize display zoom and window zoom

Pavel Grunt pgrunt at redhat.com
Fri May 22 08:53:06 UTC 2015


Related: https://bugs.freedesktop.org/show_bug.cgi?id=90582
---
 src/virt-viewer-window.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index d67fbc1..2a72207 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -1327,6 +1327,15 @@ display_show_hint(VirtViewerDisplay *display,
 
     gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-file-screenshot")), hint);
 }
+
+static void
+display_zoom_changed(VirtViewerDisplay *display,
+                     GParamSpec *pspec G_GNUC_UNUSED,
+                     VirtViewerWindow *self)
+{
+    self->priv->zoomlevel = virt_viewer_display_get_zoom_level(display);
+}
+
 static gboolean
 window_key_pressed (GtkWidget *widget G_GNUC_UNUSED,
                     GdkEvent  *event,
@@ -1381,6 +1390,8 @@ virt_viewer_window_set_display(VirtViewerWindow *self, VirtViewerDisplay *displa
                                           G_CALLBACK(virt_viewer_window_desktop_resize), self, 0);
         virt_viewer_signal_connect_object(display, "notify::show-hint",
                                           G_CALLBACK(display_show_hint), self, 0);
+        virt_viewer_signal_connect_object(display, "notify::zoom-level",
+                                          G_CALLBACK(display_zoom_changed), self, 0);
 
         display_show_hint(display, NULL, self);
 
-- 
2.4.1




More information about the virt-tools-list mailing list