[virt-tools-list] [PATCH virt-viewer 1/3] virt-viewer-window: Set zoom when display is enabled and ready.
Pavel Grunt
pgrunt at redhat.com
Sun Apr 5 13:45:00 UTC 2015
The display has default dimensions (100x100) when it is disabled.
Calculating the minimal zoom for the display will give wrong value
for the newly opened display.
It is better to wait for setting the zoom level to the moment when
the display is enabled and ready.
Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1206460
---
src/virt-viewer-window.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index c660778..e4ec265 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -1281,6 +1281,10 @@ display_show_hint(VirtViewerDisplay *display,
hint = (hint & VIRT_VIEWER_DISPLAY_SHOW_HINT_READY);
+ if (hint && virt_viewer_display_get_enabled(display)) {
+ virt_viewer_window_set_zoom_level(self, self->priv->zoomlevel);
+ }
+
gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-file-screenshot")), hint);
}
static gboolean
@@ -1310,7 +1314,6 @@ virt_viewer_window_set_display(VirtViewerWindow *self, VirtViewerDisplay *displa
if (display != NULL) {
priv->display = g_object_ref(display);
- virt_viewer_window_set_zoom_level(self, priv->zoomlevel);
virt_viewer_display_set_monitor(VIRT_VIEWER_DISPLAY(priv->display), priv->fullscreen_monitor);
virt_viewer_display_set_fullscreen(VIRT_VIEWER_DISPLAY(priv->display), priv->fullscreen);
--
2.3.4
More information about the virt-tools-list
mailing list