Re: [gtk-vnc-devel] Scaling down



On Thu, Jun 05, 2008 at 09:42:16AM -0500, Anthony Liguori wrote:
> Daniel P. Berrange wrote:
> >On Wed, Jun 04, 2008 at 09:33:49PM -0300, Jonh Wendell wrote:
> >  
> >>Is it too hard to make gtk-vnc do scaling down? I know nothing about
> >>opengl... but I can try...
> >>    
> >
> >The GL bit probably already works. I believe what will stop it is the
> >GTK sizing logic. We call set_size_request() IIRC which GTK will honour
> >as the minimum allowed size of the widget when laying out the window. 
> >  
> 
> When scaling is enabled, it stops doing set_size_request()s.  For 
> thumb-nail scaling, I would set_size_request() manually.

Yes, but even when scaling  is enabled, when first connecting to the
server it will be in 1:1 mode, which GTK-VNC optimizes to use GDK and
thus calls set_size_request(). Once that's called, even though you can
now scale the display you can't scale it smaller due to this initial
call. 

We probably need to conditionalize set_size_request() based on whether
the scaling flag is enabled or not, instead of whether we're drawing
when GL vs GDK.

> >It'll happily give it extra space (hence scaling up) but will not want
> >to give it less. The GTK sizing logic is confusing as hell to me so I
> >can't suggest any definite solution, other than to play around with it
> >and try and find something which works.
> >  
> 
> The GTK sizing stuff is very bizarre.  I've fought with it a lot.  I'm 
> not sure there's an ideal way to deal with it other than doing 
> set_size_request.

When scaling is enabled, we need to just call set_size_request(1,1) 
perhaps, and let the container widget decide upon its preferred size.
The container can query the true native desktop size, so can do the
set_size_requests() on the container instead if desired. 

Dan.
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




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