|
|
eec4b3 |
From bca8df0e4bf7d63b5c954ea79e1020407905bbe8 Mon Sep 17 00:00:00 2001
|
|
|
eec4b3 |
From: Pavel Grunt <pgrunt@redhat.com>
|
|
|
eec4b3 |
Date: Sun, 5 Apr 2015 15:45:01 +0200
|
|
|
eec4b3 |
Subject: [PATCH] virt-viewer-window: Return early when zoom of window and zoom
|
|
|
eec4b3 |
of display are same
|
|
|
eec4b3 |
|
|
|
eec4b3 |
The zoom level should be changed when zoom levels of the window and
|
|
|
eec4b3 |
the display are different. It is wrong to check the previous value of
|
|
|
eec4b3 |
the window because it could be set just for the window and not for
|
|
|
eec4b3 |
the display (e.g. when setting zoom level using the command line).
|
|
|
eec4b3 |
|
|
|
eec4b3 |
Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1206460
|
|
|
eec4b3 |
|
|
|
eec4b3 |
(cherry picked from commit 01249f703263ef6a8be59479df5cf6c5e8b1ceb9)
|
|
|
eec4b3 |
---
|
|
|
eec4b3 |
src/virt-viewer-window.c | 5 ++---
|
|
|
eec4b3 |
1 file changed, 2 insertions(+), 3 deletions(-)
|
|
|
eec4b3 |
|
|
|
eec4b3 |
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
|
|
|
eec4b3 |
index f185eb9..6a337da 100644
|
|
|
eec4b3 |
--- a/src/virt-viewer-window.c
|
|
|
eec4b3 |
+++ b/src/virt-viewer-window.c
|
|
|
eec4b3 |
@@ -1400,11 +1400,10 @@ void
|
|
|
eec4b3 |
virt_viewer_window_set_zoom_level(VirtViewerWindow *self, gint zoom_level)
|
|
|
eec4b3 |
{
|
|
|
eec4b3 |
VirtViewerWindowPrivate *priv;
|
|
|
eec4b3 |
- gint min_zoom, old_zoom;
|
|
|
eec4b3 |
+ gint min_zoom;
|
|
|
eec4b3 |
|
|
|
eec4b3 |
g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self));
|
|
|
eec4b3 |
priv = self->priv;
|
|
|
eec4b3 |
- old_zoom = priv->zoomlevel;
|
|
|
eec4b3 |
|
|
|
eec4b3 |
if (zoom_level < MIN_ZOOM_LEVEL)
|
|
|
eec4b3 |
zoom_level = MIN_ZOOM_LEVEL;
|
|
|
eec4b3 |
@@ -1421,7 +1420,7 @@ virt_viewer_window_set_zoom_level(VirtViewerWindow *self, gint zoom_level)
|
|
|
eec4b3 |
priv->zoomlevel = min_zoom;
|
|
|
eec4b3 |
}
|
|
|
eec4b3 |
|
|
|
eec4b3 |
- if (priv->zoomlevel == old_zoom) {
|
|
|
eec4b3 |
+ if (priv->zoomlevel == virt_viewer_display_get_zoom_level(priv->display)) {
|
|
|
eec4b3 |
g_debug("Zoom level not changed, using: %d", priv->zoomlevel);
|
|
|
eec4b3 |
return;
|
|
|
eec4b3 |
}
|