Skip to content

Commit fb9d118

Browse files
Javier Celayaxerus
Javier Celaya
authored andcommitted
Spice-widget: Allow smaller widget with scaling enabled
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. Acked-by: Pavel Grunt <[email protected]>
1 parent 2293b29 commit fb9d118

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/spice-widget.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ static void update_area(SpiceDisplay *display, gint x, gint y, gint width, gint
117117
static void release_keys(SpiceDisplay *display);
118118
static void size_allocate(GtkWidget *widget, GtkAllocation *conf, gpointer data);
119119
static gboolean draw_event(GtkWidget *widget, cairo_t *cr, gpointer data);
120+
static void update_size_request(SpiceDisplay *display);
120121

121122
/* ---------------------------------------------------------------- */
122123

@@ -180,14 +181,15 @@ static void scaling_updated(SpiceDisplay *display)
180181
if (d->ximage && window) { /* if not yet shown */
181182
gtk_widget_queue_draw(GTK_WIDGET(display));
182183
}
184+
update_size_request(display);
183185
}
184186

185187
static void update_size_request(SpiceDisplay *display)
186188
{
187189
SpiceDisplayPrivate *d = display->priv;
188190
gint reqwidth, reqheight;
189191

190-
if (d->resize_guest_enable) {
192+
if (d->resize_guest_enable || d->allow_scaling) {
191193
reqwidth = 640;
192194
reqheight = 480;
193195
} else {

0 commit comments

Comments
 (0)