On Tue, 12 Jun 2012 at 7:49:47 +0200, Rodolfo kix Garcia wrote: > > > >>To do it, I created two patches. The first patch breaks the > >>dependency between create+paint an icon. Now, if we create an icon, > >>we call "wIconCreate". If we needs paint it, then calls > >>"paint_icon". > > > >Your patch does not seem to quite match your description, you > >removed the > >paint_icon() call from wIconUpdate() and added it right after > >all 11 calls to wIconUpdate(). So it looks like this is related to > >"update" and not "create". > > Yes. This is because wIconUpdate is used in two cases: > > 1. When the icon is created (wIconCreate), we call wIconUpdate to > finish the icon creation. Really is like wIconCreate is splitted in > wIconCreate and wIconUpdate. > 2. When the icon changes in X11. When the icon changes, then we call > wIconUpdate. We don't need call wIconCreate, because the struct is > created and only the icon could be modified. > > But... really we need paint the icon? For example, we need paint the > icon when is updated and no_appicon is set? IMO No. This is the > reason because I did this change, probably we need tweak it a little > the different cases and check if we need call always paint_icon.
Wouldn't it be better to simply check for no_appicon inside wIconPaint() and return early if it is set? That makes more sense to me. > >But I did not understand why you still want to create the appicon > >even if no_appicon is set. Isn't that a waste of energy? What am I > >missing? > > Yes. Reasons: > > 1. We remove extracIcon, but we need save the icon in CachedPixmaps > because the icon can be used when we dock the application. Then we > must create the icon, and then save it. > 2. The appicon is used in three different parts of the code. As > "appicon" (the app icon), as "miniwindow" (the icon when the > application is minimized) and the icon in the switchpanel (alt + > tab). The icon in the docks is icon saved in CachedPixmaps > previously, but is the same icon than the other three cases. Now, > with this code, the icon is created always. Is a waste of energy, > no; because for example, if we create an application without > appicon, we will still use the icon when we minimize the window, or > if we make alt+tab. Why create the icon in that cases and then > remove it. For example if I do "alt+tab" three times, the icon is > created, updated, painted and removed three times! > > This is the idea of these patches: > > 1. Create the icon ONE time in the code. > 2. Update it when needed: When is created and if the icon changes in > X11 > 3. Use the SAME icon in all parts of the code > 4. Delete the icon only ONE time in the code. > > We can remove more code with this idea, because > wApplication->AppIcon always exists, for example the function > addIconForWindow() in the switchpanel.c always will find the icon in > wapp->appicon->icon, then it don't needs finds (and creates if not > found) the image. Ok, makes sense. > PS. Carlos, you get the Yast2 icon? I was already getting the correct icon before the patch too, since updating to openSUSE 12.1 :-) But there is a problem with your patch. I don't have time now, but the icons are not positioned at the botton left of the screen, they are shifted around 100 pixels to the right. -- To unsubscribe, send mail to [email protected].
