On 2012-11-15 03:32, BALATON Zoltan wrote:
On Wed, 14 Nov 2012, Rodolfo García Peñas wrote:
Then, the image can be resized using wIconValidateIconSize(). The resize should be done in get_rimage_icon_from_wm_hints(), not in the function
get_wwindow_image_from_wmhints(). This is because the function
get_wwindow_image_from_wmhints() is used in wIconStore() too. If we resize the image before save it to disk, then if we change the icon/dock size, then the image saved will have a different size than the curren icon size. Is better resize the image when is painted in the screen, not the image saved.

Thanks a lot for fixing all this. I couldn't really follow all your
changes so I'm not sure how it all works now so here are some
questions/thoughts. I think you've thought about these already but
asking it just in case:

Hi!,

I am busy these days :-( a lot of work. I will try to release the patch about winspector these weekend. Sorry for the delay.

- This does not mean that the image is resized every time it is
painted, does it? If yes then it may be faster to check the size of
the cached image before using it and remove it when the icon size has
been changed.

Yes and no. There are two steps in the image usage:

1. Read the file/X11/... and load the image in icon->file_image (wIconUpdate) 2. Paint the image. Read the icon->file_image and paint it in the screen as pixmap (update_pixmap() or something like).

Things:
- Now, the image at wIconUpdate (step 1) is only changed when is loaded first time and if the image changes. - The image is painted and painted (step 2) multiple times in the wmaker session, for example selecting windows,.. - The image resize is done in the process at wIconUpdate, so is only resized when the image is loaded or changed, not when is painted.

Therefore, the image is resized (if needed) only one time when the application is running.

The image is not resized when it is saved as cache icon. Why? because if we change the icon size, then the caché image has a wrong size.

- Images are also enlarged when they are too small? This may look bad
so probably there could be a limit (say no more than 2x) or only scale
down images if they are too big but never enlarge them.

No. But could be easy to implement. Now, all image resize is done at wIconValidateIconSize(). This function is quick, because see the image width and height and resize it only if the image is bigger than the icon size.

If you want it, I can do it. I am not sure about the quality of the resize image, but I think wrlib includes some functions to do it fine.

- Is it possible to change icons of applications without restarting
them (the Apply button in the inspector is working) and does the
ignore client supplied icon option work?

Yes. I am working in the patch. I will try to release the patches this weekend.

Regards,
BALATON Zoltan

Thanks a lot for your comments/ideas.
kix
--
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/


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

Reply via email to