On Fri, Oct 08, 2010 at 11:17:36PM +0200, Carlos R. Mafra wrote:
> 
> >  WApplication *wApplicationCreate(WWindow * wwin)
> >  {
> >     WScreen *scr = wwin->screen_ptr;
> > @@ -324,6 +309,7 @@ WApplication *wApplicationCreate(WWindow * wwin)
> >                     if (mainw->wm_hints && (mainw->wm_hints->flags & 
> > IconWindowHint))
> >                             wapp->app_icon->icon->icon_win = 
> > mainw->wm_hints->icon_window;
> >                     wAppIconPaint(wapp->app_icon);
> > +                   wAppIconSave(wapp->app_icon);
> >             } else {
> >                     wapp->app_icon = wAppIconCreate(wapp->main_window_desc);
> >             }
> > @@ -381,8 +367,8 @@ WApplication *wApplicationCreate(WWindow * wwin)
> >             }
> >  
> >             /* if the displayed icon was supplied by the client, save the 
> > icon */
> > -           if (!tmp)
> > -                   extractClientIcon(wapp->app_icon);
> > +           if (!tmp || strstr(tmp, "Library/WindowMaker/CachedPixmaps") != 
> > NULL)
> > +                   wAppIconSave(wapp->app_icon);
> >     }
> >     return wapp;
> >  }
> 
> I am trying to understand why don't you simply kill the whole "let's look
> in WMWindowAttributes if we ever saved a icon for this application in 
> CachedPixmaps, and let's save it again if we did and the icon is no 
> longer there" logic.

Note that wAppIconSave does nothing unless the app icon is currently
docked, so this won't re-save the icon unless it's docked.

> Perhaps I am missing something with this patch. But I think the diff
> below could be added on top of your series. I just tested it and
> I couldn't detect any bad effects (and no icon was saved in
> CachedPixmap even if there was an old "Icon=" line in
> WMWindowAttributes). What do you think?

If a new version of the app supplies a cool new icon, wmaker won't
notice with your patch. And in fact, it will show the old icon until the
app is launched, change to the new icon while the app is running, and
then change back to the old when the app terminates.

> Another thing. On wAppIconSave() you save the icon only if
> the app is docked. But what prevents wmaker from saving
> a new icon (rewriting the old) every time you open an
> already-docked application?

Nothing does. If you can think of a good way to do "save it only if it
changed" without running into the problem above, go ahead.


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

Reply via email to