[Spice-devel] [PATCH 4/4] Simplify spice_main_update_display_enabled()

Jonathon Jongsma jjongsma at redhat.com
Tue Aug 4 09:42:28 PDT 2015


On Thu, 2015-07-16 at 18:18 -0400, Marc-André Lureau wrote:
> Hi
> 
> ----- Original Message -----
> > When id is -1, we disable or enable all displays. To simplify the logic,
> > just call this function recursively in this case.
> > ---
> >  src/channel-main.c | 13 +++++++------
> >  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> Is this really simplified?

Yeah, it made more sense when I had some other changes that I have since
reverted. I'll drop this patch.



> 
> > 
> > diff --git a/src/channel-main.c b/src/channel-main.c
> > index 3b9d5b1..9383dbf 100644
> > --- a/src/channel-main.c
> > +++ b/src/channel-main.c
> > @@ -2784,15 +2784,16 @@ void
> > spice_main_update_display_enabled(SpiceMainChannel *channel, int id, gboole
> >      if (id == -1) {
> >          gint i;
> >          for (i = 0; i < G_N_ELEMENTS(c->display); i++) {
> > -            c->display[i].display_state = display_state;
> > -        }
> > -    } else {
> > -        g_return_if_fail(id < G_N_ELEMENTS(c->display));
> > -        if (c->display[id].display_state == display_state)
> > +            spice_main_update_display_enabled(channel, i, enabled, update);
> >              return;
> > -        c->display[id].display_state = display_state;
> > +        }
> >      }
> >  
> > +    g_return_if_fail(id < G_N_ELEMENTS(c->display));
> > +    if (c->display[id].display_state == display_state)
> > +        return;
> > +    c->display[id].display_state = display_state;
> > +
> >      if (update)
> >          update_display_timer(channel, 1);
> >  }
> > --
> > 2.1.0
> > 
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> > 




More information about the Spice-devel mailing list