[Spice-devel] [spice-gtk] Spice-widget: Allow smaller widget with scaling enabled
Javier Celaya
javier.celaya at flexvdi.com
Fri Apr 22 07:57:08 UTC 2016
Hi
El 22/04/16 a las 09:19, Pavel Grunt escribió:
> Hi Javier,
>
> sorry, I must have missed the patch. Can you please explain the problem? How to
> reproduce it? Is it about spicy?
Sorry, the commit message may be a bit short. I'll send a second version
with a longer explanation, along with the the declaration of
update_size_request().
I found the problem with spicy, but I suppose it affects other clients
too. You can reproduce it checking the "scale display" option and
unchecking the "resize guest to match window size" option. Then, the
spice widget takes a minimum size of the current guest resolution. The
window can be made bigger, but never smaller.
>
> About the patch - you should declare the update_size_request() function instead
> of moving scaling_updated() down - it would be more clear what has changed.
>
> Thanks,
> Pavel
>
> On Fri, 2016-04-22 at 08:06 +0200, Javier Celaya wrote:
>> Can someone review this patch, please?
>> Thank you
>>
>> El 13/04/16 a las 13:42, Javier Celaya escribió:
>>> With scaling enabled, the size request of the widget must be 640x480
>>> (the same as with resize_guest_enable) so that the widget can be
>>> actually scalled down.
>>> ---
>>> src/spice-widget.c | 25 +++++++++++++------------
>>> 1 file changed, 13 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/src/spice-widget.c b/src/spice-widget.c
>>> index 6f638fb..f445f3f 100644
>>> --- a/src/spice-widget.c
>>> +++ b/src/spice-widget.c
>>> @@ -169,23 +169,12 @@ static void
>>> spice_display_get_property(GObject *object,
>>> }
>>> }
>>>
>>> -static void scaling_updated(SpiceDisplay *display)
>>> -{
>>> - SpiceDisplayPrivate *d = display->priv;
>>> - GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(display));
>>> -
>>> - recalc_geometry(GTK_WIDGET(display));
>>> - if (d->ximage && window) { /* if not yet shown */
>>> - gtk_widget_queue_draw(GTK_WIDGET(display));
>>> - }
>>> -}
>>> -
>>> static void update_size_request(SpiceDisplay *display)
>>> {
>>> SpiceDisplayPrivate *d = display->priv;
>>> gint reqwidth, reqheight;
>>>
>>> - if (d->resize_guest_enable) {
>>> + if (d->resize_guest_enable || d->allow_scaling) {
>>> reqwidth = 640;
>>> reqheight = 480;
>>> } else {
>>> @@ -197,6 +186,18 @@ static void update_size_request(SpiceDisplay *display)
>>> recalc_geometry(GTK_WIDGET(display));
>>> }
>>>
>>> +static void scaling_updated(SpiceDisplay *display)
>>> +{
>>> + SpiceDisplayPrivate *d = display->priv;
>>> + GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(display));
>>> +
>>> + recalc_geometry(GTK_WIDGET(display));
>>> + if (d->ximage && window) { /* if not yet shown */
>>> + gtk_widget_queue_draw(GTK_WIDGET(display));
>>> + }
>>> + update_size_request(display);
>>> +}
>>> +
>>> static void update_keyboard_focus(SpiceDisplay *display, gboolean state)
>>> {
>>> SpiceDisplayPrivate *d = display->priv;
>>
>> --
>>
>>
>> Javier Celaya Software Engineer javier.celaya at flexvdi.com
>> +34 876 60 00 73 @j_celaya
>> _______________________________________________
>> Spice-devel mailing list
>> Spice-devel at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/spice-devel
--
<http://flexvdi.com><http://flexvdi.com>
Javier Celaya
Software Engineer
j <mailto:javier.celaya at flexvdi.com>avier.celaya at flexvdi.com
+34 876 60 00 73
@j_celaya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160422/0164fb98/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo.flexvdi.png
Type: image/png
Size: 17075 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160422/0164fb98/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mail.png
Type: image/png
Size: 9350 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160422/0164fb98/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: phone.png
Type: image/png
Size: 15099 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160422/0164fb98/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: skype.png
Type: image/png
Size: 14444 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160422/0164fb98/attachment-0007.png>
More information about the Spice-devel
mailing list