Re: [PATCH virt-viewer 1/2] resize: avoid rounding issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 11, 2014 at 04:38:45PM +0100, Marc-André Lureau wrote:
> From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> 
> desktopWidth / desktopAspect
> = desktopWidth / ((double)desktopWidth / (double)desktopHeight)
> = desktopHeight
> 
> This solves the display being blurry with some resolutions:
> https://bugzilla.redhat.com/show_bug.cgi?id=1056041
> ---
>  src/virt-viewer-window.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> index 05d5fe7..08cacd5 100644
> --- a/src/virt-viewer-window.c
> +++ b/src/virt-viewer-window.c
> @@ -450,7 +450,7 @@ virt_viewer_window_resize(VirtViewerWindow *self, gboolean keep_win_size)
>              height = desktopHeight;
>          } else {
>              width = desktopWidth;
> -            height = desktopWidth / desktopAspect;
> +            height = desktopHeight;

This isn't right - now this 'else' clause is not reducing the size
at all when it is too large to display, but the 'if' does.

I think they are actually both wrong and what it should have been
doing is this:

  if (screenAspect > desktopAspect) {
     height = fullscreen.height - 128;
     width = height * desktopAspect;
  } else {
     width = fullscreen.width - 128;
     height = width / desktopAspect;
  }

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list





[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux