[virt-tools-list] [virt-viewer][PATCH 1/5 v2] display: remove useless identation level

Fabiano Fidêncio fabiano at fidencio.org
Wed Apr 22 09:38:59 UTC 2015


On Wed, Apr 22, 2015 at 11:19 AM, Christophe Fergeau
<cfergeau at redhat.com> wrote:
> ACK series, though I'm not a big fan of calling
> spice_channel_get_error() from arbitrary places (it's basically only
> usable from virt_viewer_session_spice_main_channel_event()).
>
> Christophe
>
> On Wed, Apr 15, 2015 at 12:03:20PM +0200, Fabiano Fidêncio wrote:
>> ---
>>  src/virt-viewer-display.c | 44 +++++++++++++++++++++-----------------------
>>  1 file changed, 21 insertions(+), 23 deletions(-)
>>
>> diff --git a/src/virt-viewer-display.c b/src/virt-viewer-display.c
>> index ddbb045..3efe24c 100644
>> --- a/src/virt-viewer-display.c
>> +++ b/src/virt-viewer-display.c
>> @@ -798,31 +798,29 @@ void virt_viewer_display_get_preferred_monitor_geometry(VirtViewerDisplay* self,
>>      topx = MAX(topx, 0);
>>      topy = MAX(topy, 0);
>>
>> -    {
>> -        if (virt_viewer_display_get_fullscreen(VIRT_VIEWER_DISPLAY(self))) {
>> -            GdkRectangle physical_monitor;
>> -            GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(self));
>> -            int n = virt_viewer_display_get_monitor(VIRT_VIEWER_DISPLAY(self));
>> -            if (n == -1)
>> -                n = gdk_screen_get_monitor_at_window(screen,
>> -                                                     gtk_widget_get_window(GTK_WIDGET(self)));
>> -            gdk_screen_get_monitor_geometry(screen, n, &physical_monitor);
>> -            preferred->x = physical_monitor.x;
>> -            preferred->y = physical_monitor.y;
>> -            preferred->width = physical_monitor.width;
>> -            preferred->height = physical_monitor.height;
>> -        } else {
>> -            gtk_widget_get_allocation(GTK_WIDGET(self), preferred);
>> -            preferred->x = topx;
>> -            preferred->y = topy;
>> -        }
>> +    if (virt_viewer_display_get_fullscreen(VIRT_VIEWER_DISPLAY(self))) {
>> +        GdkRectangle physical_monitor;
>> +        GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(self));
>> +        int n = virt_viewer_display_get_monitor(VIRT_VIEWER_DISPLAY(self));
>> +        if (n == -1)
>> +            n = gdk_screen_get_monitor_at_window(screen,
>> +                                                 gtk_widget_get_window(GTK_WIDGET(self)));
>> +        gdk_screen_get_monitor_geometry(screen, n, &physical_monitor);
>> +        preferred->x = physical_monitor.x;
>> +        preferred->y = physical_monitor.y;
>> +        preferred->width = physical_monitor.width;
>> +        preferred->height = physical_monitor.height;
>> +    } else {
>> +        gtk_widget_get_allocation(GTK_WIDGET(self), preferred);
>> +        preferred->x = topx;
>> +        preferred->y = topy;
>> +    }
>>
>> -        if (virt_viewer_display_get_zoom(VIRT_VIEWER_DISPLAY(self))) {
>> -            guint zoom = virt_viewer_display_get_zoom_level(VIRT_VIEWER_DISPLAY(self));
>> +    if (virt_viewer_display_get_zoom(VIRT_VIEWER_DISPLAY(self))) {
>> +        guint zoom = virt_viewer_display_get_zoom_level(VIRT_VIEWER_DISPLAY(self));
>>
>> -            preferred->width = round(preferred->width * NORMAL_ZOOM_LEVEL / zoom);
>> -            preferred->height = round(preferred->height * NORMAL_ZOOM_LEVEL / zoom);
>> -        }
>> +        preferred->width = round(preferred->width * NORMAL_ZOOM_LEVEL / zoom);
>> +        preferred->height = round(preferred->height * NORMAL_ZOOM_LEVEL / zoom);
>>      }
>>  }
>>
>> --
>> 2.3.5
>>
>> _______________________________________________
>> virt-tools-list mailing list
>> virt-tools-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/virt-tools-list
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

Pushed the series and would be nice to bring back the discussion to
_get_error() some time soon.
For now I'm going for this as it is pretty much as it was before my changes.

Best Regards and thanks for the reviews.
-- 
Fabiano Fidêncio




More information about the virt-tools-list mailing list