Re: [patch] keep aspect ratio on scaling



On Fri, Oct 16, 2009 at 10:01:18AM -0300, Jonh Wendell wrote:
> Hi, folks.
> 
> Attached is a patch which keeps the aspect ratio when using scaling.
> I've tested it a bit with vinagre and it seems to work well, although
> it's kind slower than before, I guess... (at least it's slower than
> vncviewer :) ), cairo's fault?

I'm not sure why its noticably slower - the only extra cairo call was
the background fill which I shouldn't thing would impact things.

That said, I'm not sure that we should be forcing an aspect ratio inside
Gtk-Vnc itself, since there may be scenarios where apps want it to fill
the whole area. The application using Gtk-Vnc already has the option to
control its aspect ratio if desired, via the parent layout.

For example in virt-viewer, I apply the following logic

  - Scaling is enabled permanently
  - When desktop-resize is emitted
      - If user has manually changed the window size, then let
        Gtk-Vnc automatically scale to this available size
      - Else try to resize the top level window, maintaining
        the VNC aspect ratio

The VncDisplay widget is placed inside a GtkAlignment, and when the
top level window is changed, we update the GtkAlignement child 
allocation to control aspect ratio of the VncDisplay

Daniel
-- 
|: http://berrange.com/     -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://freshmeat.net/~danielpb/    -o-   http://gtk-vnc.sourceforge.net :|


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