[virt-tools-list] [virt-viewer 2/3] display: use MIN_DISPLAY_{WIDTH, HEIGHT} as the minimum possible value

Pavel Grunt pgrunt at redhat.com
Mon Jun 13 07:12:49 UTC 2016


On Fri, 2016-06-10 at 17:22 +0200, Fabiano Fidêncio wrote:
> Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
Acked-by: Pavel Grunt <pgrunt at redhat.com>
> ---
>  src/virt-viewer-display.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/virt-viewer-display.c b/src/virt-viewer-display.c
> index c2e6c4d..2dbaba1 100644
> --- a/src/virt-viewer-display.c
> +++ b/src/virt-viewer-display.c
> @@ -419,8 +419,8 @@ virt_viewer_display_size_allocate(GtkWidget *widget,
>  
>      border_width = gtk_container_get_border_width(GTK_CONTAINER(display));
>  
> -    width  = MAX(1, allocation->width - 2 * border_width);
> -    height = MAX(1, allocation->height - 2 * border_width);
> +    width  = MAX(MIN_DISPLAY_WIDTH, allocation->width - 2 * border_width);
> +    height = MAX(MIN_DISPLAY_HEIGHT, allocation->height - 2 * border_width);
>  
>      desktopAspect = (double) priv->desktopWidth / (double) priv-
> >desktopHeight;
>      actualAspect = (double) width / (double) height;




More information about the virt-tools-list mailing list