On Sat, 23 Mar 2013 at 16:58:13 +0100, Rodolfo García Peñas wrote:
> Hi,
> 
> On Fri, 22 Mar 2013, [email protected] escribió:
> 
> > From: Daniel Déchelotte <[email protected]>
> > 
> > ---
> >  src/dock.c |   47 +++++++++++++++++++++++++++--------------------
> >  1 file changed, 27 insertions(+), 20 deletions(-)
> > 
> > diff --git a/src/dock.c b/src/dock.c
> > index a73e8c5..f9090ce 100644
> > --- a/src/dock.c
> > +++ b/src/dock.c
> > @@ -441,14 +441,35 @@ static void omnipresentCallback(WMenu *menu, 
> > WMenuEntry *entry)
> >     }
> >  }
> 
> I like this new function, with or without Drawer, because makes the function 
> removeIconsCallback() smaller and clear.
> 
> > +static void removeIcons(WMArray *icons, WDock *dock)
> > +{
> > +    WAppIcon *aicon;
> > +    int keepit;
> > +    WMArrayIterator it;
> > +
> > +   WM_ITERATE_ARRAY(icons, aicon, it) {
> > +           keepit = aicon->running && wApplicationOf(aicon->main_window);
> > +           wDockDetach(dock, aicon);
> > +           if (keepit) {
> > +                   /* XXX: can: aicon->icon == NULL ? */
> 
> If you create the new function, this comment should change to /* aicon->icon 
> always exists */ or something like.
> 
> > +                   PlaceIcon(dock->screen_ptr, &aicon->x_pos, 
> > &aicon->y_pos,
> > +                             wGetHeadForWindow(aicon->icon->owner));
> > +                   XMoveWindow(dpy, aicon->icon->core->window, 
> > aicon->x_pos, aicon->y_pos);
> > +                   if (!dock->mapped || dock->collapsed)
> > +                           XMapWindow(dpy, aicon->icon->core->window);
> > +           }
> > +   }
> > +   WMFreeArray(icons);
> > +
> > +   if (wPreferences.auto_arrange_icons)
> > +           wArrangeIcons(dock->screen_ptr, True);
> > +}
> > +
> [snip]
> 
> But IMO we should split this patch in two, one create the new removeIcons() 
> function and other add the drawer switch:
> 
> >     if (WMGetArrayItemCount(selectedIcons)) {
> > -           if (wMessageDialog(dock->screen_ptr, _("Workspace Clip"),
> > +           if (wMessageDialog(dock->screen_ptr,
> > +                              dock->type == WM_CLIP ? _("Workspace Clip") 
> > : _("Drawer"),
> >                                _("All selected icons will be removed!"),
> >                                _("OK"), _("Cancel"), NULL) != WAPRDefault) {
> >                     WMFreeArray(selectedIcons);
> [snip]
> 
> Then, if the Drawer option is not included in wmaker, the function can 
> continue splitted, because are different patches.

Yes, definitely. There are two independent changes in this patch.


-- 
To unsubscribe, send mail to [email protected].

Reply via email to