From: "Rodolfo García Peñas (kix)" <[email protected]>
These patches removes the force_paint flag. A little explanation:
The function wIconPaint was something like this:
void wIconPaint(WIcon *icon)
{
WScreen *scr = icon->core->screen_ptr;
int x;
char *tmp;
if (icon->force_paint) {
icon->force_paint = 0;
wIconUpdate(icon);
return;
}
...
Then, in other parts of the code, was possible to do "icon->force_paint = 1",
then, when wIconPaint was called, the flow was (force_paint value):
wIconPaint(1) -> wIconUpdate(0) -> wIconPaint(0)
IMO is better if the icon needs to be (re)created, call it and then update it:
wIconUpdate;
wIconPaint;
But this is not always possible, for example with AppIcons, because we are
creating the icon, but is not created yet,...
These patches moves, step by step, the force_paint flag as argument between
functions, then remove it.
First, pass as argument (patches 1 and 2). Example:
- wapp->app_icon->icon->force_paint = 1;
- wAppIconPaint(wapp->app_icon);
+ wAppIconPaint(wapp->app_icon, True);
The patch 3 removes the force flag, because the info is in the functions, as
argument.
The patch 4 changes the "True" (force create icon) to "False", and create the
icon in that place:
- wAppIconPaint(wapp->app_icon, True);
+
+ /* Update the icon images */
+ wIconUpdate(wapp->app_icon->icon);
+
+ /* Paint it */
+ wAppIconPaint(wapp->app_icon, False);
Patch 5, undo the patch 2, removing the wAppIconPaint argument because is always
False. I cannot remove the argument to patch 1 and wDockAttachIcon() must give
if need the icon udpated or not (but IMO is better, because the function know
if the icon is shadowed,... and the icon must or not be updated).
Cheers,
kix
--
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
--
To unsubscribe, send mail to [email protected].