Re: [PATCH virt-viewer 1/2] Remove special-case for getting window n=0

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

 



ack

On Thu, Mar 6, 2014 at 11:17 PM, Jonathon Jongsma <jjongsma@xxxxxxxxxx> wrote:
> virt_viewer_app_get_nth_window() will return the proper window when passed 0 for
> the 'nth' argument, so there's no need to avoid calling it in this case.  It
> just complicates the code logic.
> ---
>  src/virt-viewer-app.c | 22 +++++++++-------------
>  1 file changed, 9 insertions(+), 13 deletions(-)
>
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index e134894..484762e 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -838,20 +838,16 @@ virt_viewer_app_display_added(VirtViewerSession *session G_GNUC_UNUSED,
>      gint nth;
>
>      g_object_get(display, "nth-display", &nth, NULL);
> -    if (nth == 0) {
> -        window = priv->main_window;
> -    } else {
> -        window = virt_viewer_app_get_nth_window(self, nth);
> -        if (window == NULL) {
> -            if (priv->kiosk) {
> -                /* don't show extra monitors that don't fit on client */
> -                g_debug("kiosk mode: skip extra monitors that don't fit on client");
> -                g_object_unref(display);
> -                return;
> -            }
> -
> -            window = virt_viewer_app_window_new(self, nth);
> +    window = virt_viewer_app_get_nth_window(self, nth);
> +    if (window == NULL) {
> +        if (priv->kiosk) {
> +            /* don't show extra monitors that don't fit on client */
> +            g_debug("kiosk mode: skip extra monitors that don't fit on client");
> +            g_object_unref(display);
> +            return;
>          }
> +
> +        window = virt_viewer_app_window_new(self, nth);
>      }
>
>      virt_viewer_window_set_display(window, display);
> --
> 1.8.5.3
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/virt-tools-list



-- 
Marc-André Lureau

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list





[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux