[Spice-devel] [spice-gtk v2] Spice-widget: Allow smaller widget with scaling enabled
Javier Celaya
javier.celaya at flexvdi.com
Fri Apr 22 08:08:02 UTC 2016
When resize-guest-to-match-window-size is disabled, the size request
(minimum size) of the spice widget is set to the current guest
resolution. The client window cannot be made smaller, even with
scale-display enabled.
This patch sets a size request of 640x480 when either
resize-guest-to-match-window-size OR scale-display are enabled, making
it posible to shrink the window and scale down the display.
---
src/spice-widget.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 6f638fb..a7f31c4 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -169,6 +169,8 @@ static void spice_display_get_property(GObject *object,
}
}
+static void update_size_request(SpiceDisplay *display);
+
static void scaling_updated(SpiceDisplay *display)
{
SpiceDisplayPrivate *d = display->priv;
@@ -178,6 +180,7 @@ static void scaling_updated(SpiceDisplay *display)
if (d->ximage && window) { /* if not yet shown */
gtk_widget_queue_draw(GTK_WIDGET(display));
}
+ update_size_request(display);
}
static void update_size_request(SpiceDisplay *display)
@@ -185,7 +188,7 @@ static void update_size_request(SpiceDisplay *display)
SpiceDisplayPrivate *d = display->priv;
gint reqwidth, reqheight;
- if (d->resize_guest_enable) {
+ if (d->resize_guest_enable || d->allow_scaling) {
reqwidth = 640;
reqheight = 480;
} else {
--
2.4.3
More information about the Spice-devel
mailing list