From: "Rodolfo García Peñas (kix)" <[email protected]>

Hi,

first, sorry for this too many patches. I know I should send less patches 
together.

I will try to show the main ideas for the patches, All of them has a lot 
information, I spent more time with the commit documentation. Some patches 
could be rebased, some of them are splitted for better understanding, and other 
because I wrote the patch, I found a better way, then I create other patch, but 
I didn't rebase both patches (24 and 26 are an example) because I did that way. 
Feel free to rebase some of them.

I will describe some ideas later, but the main idea is faster code, less calls 
in the application creation flow. After these patches, to create an icon we use 
about 4 functions and 4 calls, before these patches, we use about the same 
functions (4,5), but about 12 calls.

I tested the patches, now all is ok here. But please, test the patches.

Main ideas:

1. Less wIconUpdate calls

wIconUpdate function is used to change the image for an icon. This function was 
used more times than we need. We should call this function when the icon image 
change or when we don't know if the image change. Else, should be replaced by 
wIconPaint (only paints and change the title) or update_icon_pixmap(icon) if we 
need recreate the pixmap. update_icon_pixmap(icon) will call wIconPaint()

To do it, I re-wrote some functions to return the RImage. Like:

0001-get_rimage_icon_from_x11-removed.patch
0002-get_rimage_icon_from_default_icon-returns-image.patch
0003-get_rimage_icon_from_icon_win-default-image.patch
0004-get_rimage_icon_from_icon_win-returns-image.patch

This is one of the most important ideas of these patches, and some patches to 
remove wIconUpdate are:

0012-icon_create_for_dock-without-wIconUpdate.patch
0015-create_appicon_from_dock-without-wIconUpdate.patch
0017-Dock-operations-don-t-need-wIconUpdate.patch
0018-removeAppIconFor-without-wIconUpdate.patch
0021-wIconUpdate-uses-get_window_image_def.patch
0022-Remove-wIconUpdate-wm_hints-dead-code.patch
0029-tileObserver-refresh-with-the-same-image.patch
0019-wClientCheckProperty-uses-updateIconImage.patch
0020-Icon-creation-for-wwindow-moved-to-a-function.patch

Then the code is faster and we have better possibilities, like create the icon 
in one step

0014-Aplication-creates-appicon-in-one-step.patch

2. Simplify function arguments

Some functions receives as argument an object, but only needs one thing. Is 
better send only the thing needed than the big object. For example, in th patch 
0005-get_rimage_icon_from_default_icon-WScreen-argument.patch, I changed WIcon 
by WScreen:

-static RImage *get_rimage_icon_from_default_icon(WIcon *icon);
+static RImage *get_rimage_icon_from_default_icon(WScreen *scr);

Then is possible use this function for code without icons. I used this idea 
with 0006-wm_hints-functions-argument-adjust.patch too.

3. Window images clear

We have two types of images, window image (net_icon_image) and icon image 
(WIcon->icon). I created some functions to get the window image using all 
possible methods and return the value using only one call. There are some 
patches with this code, like:

0007-Window-image-functions.patch
0008-Window-image-includes-wm_hints.patch
0011-wIconStore-already-includes-wm_hints-image.patch
0030-New-function-update_net_icon_image.patch

4. Updated the winspector, to get the right icons. I think now all icons work 
fine in winspector.c.

0009-winspector-applySettings-uses-get_window_image_from_.patch
0010-winspector-applySettings-include-all-client-images.patch
0035-wDefaultUpdateIcons-uses-wIconUpdate.patch

5. Clean code and remove dup code. When I wrote some code I clean the near 
functions. I send these clean patches as independent patches, but are not a 
deep clean.

0013-Icon-file-checking-and-dialog-function.patch
0023-Removed-get_rimage_icon_from_wm_hints.patch
0025-wGetIconName-False-block-moved-up.patch
0033-winspector.c-save-and-apply-Settings-code-clean.patch
0034-Set-the-right-icon-on-winspector-save.patch
0036-winspector.c-code-clean.patch

Now all windows have their own icon, not just when minimize it. Now we can 
change the icon in winspector.c, with the window open or minimized.

0031-WWindow-has-always-icon-Remove-wIconDestroy.patch
0032-WWindow-always-has-icon-Add-WIcon.patch

6. Some bugs. Other problems are resolved in the patches I did, not as 
independent patches. More info in the commit doc.

0016-Avoid-crash-in-icon-move-without-command.patch

7. Issues, not bugs:

0024-wIconChangeTitle-rewritten.patch
0026-wIconChangeTitle-rewrited.patch
0027-All-dockapps-have-bave-background.patch
0028-Dockapps-don-t-have-title.patch


Best regards,
kix
--
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/


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

Reply via email to