summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2020-12-01 16:48:09 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2020-12-01 16:53:58 +0400
commitae55e755908c7d8b02a1068bfbebe8670bf7db08 (patch)
tree63b532f6ae8a79950000a98f8080b8b02d295247 /tools
parentc829f89788e767abbcb31f75050e913a1b55279f (diff)
spicy: use the scale factor to get the display preferred dimension
Since commit b30598293b1c48b9dc0eddfde5a9fc996a83939c ("spice-widget: fix widget size request on HiDPI when scaling is disabled"), the widget requested size is divided by the scale factor. Multiply it back to get the guest display size (a more precise version would retrive the associated channel and get the "width" and "height" property from it) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/spicy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/spicy.c b/tools/spicy.c
index 8ca62f9..b786aa0 100644
--- a/tools/spicy.c
+++ b/tools/spicy.c
@@ -589,6 +589,8 @@ static void menu_cb_resize_to(GtkAction *action G_GNUC_UNUSED,
gtk_widget_get_preferred_width(win->spice, NULL, &width);
gtk_widget_get_preferred_height(win->spice, NULL, &height);
+ width *= gtk_widget_get_scale_factor(win->spice);
+ height *= gtk_widget_get_scale_factor(win->spice);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_width), width);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_height), height);