[Spice-devel] [PATCH spice-gtk 07/11] Use the border margin from recalc_geometry()
Hans de Goede
hdegoede at redhat.com
Thu Dec 8 06:55:52 PST 2011
ACK.
On 12/08/2011 03:12 PM, Marc-André Lureau wrote:
> ---
> gtk/spice-widget-cairo.c | 10 ++--------
> gtk/spice-widget.c | 1 +
> 2 files changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/gtk/spice-widget-cairo.c b/gtk/spice-widget-cairo.c
> index acb91ad..f78b670 100644
> --- a/gtk/spice-widget-cairo.c
> +++ b/gtk/spice-widget-cairo.c
> @@ -71,16 +71,10 @@ void spicex_draw_event(SpiceDisplay *display, cairo_t *cr)
> {
> SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
> int fbw = d->width, fbh = d->height;
> - int mx = 0, my = 0;
> int ww, wh;
>
> gdk_drawable_get_size(gtk_widget_get_window(GTK_WIDGET(display)),&ww,&wh);
>
> - if (ww> fbw)
> - mx = (ww - fbw) / 2;
> - if (wh> fbh)
> - my = (wh - fbh) / 2;
> -
> /* If we don't have a pixmap, or we're not scaling, then
> we need to fill with background color */
> if (!d->ximage ||
> @@ -92,7 +86,7 @@ void spicex_draw_event(SpiceDisplay *display, cairo_t *cr)
> behaviour of drawing the rectangle from right to left
> to cut out the whole */
> if (d->ximage)
> - cairo_rectangle(cr, mx + fbw, my,
> + cairo_rectangle(cr, d->mx + fbw, d->my,
> -1 * fbw, fbh);
> cairo_fill(cr);
> }
> @@ -107,7 +101,7 @@ void spicex_draw_event(SpiceDisplay *display, cairo_t *cr)
> cairo_scale(cr, sx, sy);
> cairo_set_source_surface(cr, d->ximage, 0, 0);
> } else {
> - cairo_set_source_surface(cr, d->ximage, mx, my);
> + cairo_set_source_surface(cr, d->ximage, d->mx, d->my);
> }
> cairo_paint(cr);
> }
> diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
> index 5606980..5b14ba6 100644
> --- a/gtk/spice-widget.c
> +++ b/gtk/spice-widget.c
> @@ -196,6 +196,7 @@ static void spice_display_set_property(GObject *object,
> break;
> case PROP_SCALING:
> d->allow_scaling = g_value_get_boolean(value);
> + recalc_geometry(GTK_WIDGET(display), FALSE);
> if (d->ximage&&
> gtk_widget_get_window(GTK_WIDGET(display))) { /* if not yet shown */
> int ww, wh;
More information about the Spice-devel
mailing list