Re: [gtk-vnc-devel] Scaling down



Daniel P. Berrange wrote:
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.

The scaling flag can be enabled very early if that's desired. Note that enabling scaling doesn't automatically mean you scale. If the ratio is 1:1, it still uses GDK, it just doesn't do set_size_request().

So we already have this behavior.

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.

If a user conditionally enables scaling, they should set_size_request(1, 1) IFF they haven't set window_set_resizable(False). I've always wondered if there was an unset_size_request() type operation that puts you back in the mode before any size request has been made. That would really be ideal. I've never been able to figure that out though.

Regards,

Anthony Liguori



Dan.





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