Hi,
yesterday I spent a lot of time with these problems. I need a bit help.
My current installation is a bit "rare". I have some wmaker debian packages
installed (at /usr) and the git code (at /usr/local), with my
~/GNUStep/Default/WindowMaker file configuration using both folders...
Yesterday I was working in the icons part and I changed the code of
get_default_image() to use the function get_rimage_from_file(). See the code
below.
But wmaker crash and crash when I called a application without icon (xcalc).
Why? When I call xcalc, wmaker try to find the icon "HP-16C-48.xpm", the icon
didn't exists and wmaker removes the icon from the Domain database and try to
load "defaultAppIcon.tiff". Because my installation is not standard, wmaker
didn't find "defaultAppIcon.tiff", then removes the icon from the Domain
database and try to load again the default icon, BUT, now wmaker cannot find
the icon in the Domain database because was just removed. This is the trace
using the code below:
wmaker(get_default_icon_filename(wdefaults.c:408)): warning: could not find
icon file "HP-16C-48.xpm"
dict 0xdb93f0
value LPW
file1 = defaultAppIcon.tiff
wmaker(get_rimage_from_file(wdefaults.c:439)): warning: error loading image
file "defaultAppIcon.tiff": could not open file
image = (nil)
file2 = defaultAppIcon.tiff
wmaker(get_default_image(icon.c:662)): warning: could not load default icon
"defaultAppIcon.tiff":could not open file
dict 0xdb93f0
value LPW
file1 = Ȟf�
wmaker(get_rimage_from_file(wdefaults.c:439)): warning: error loading image
file "Ȟf": could not open file
image = (nil)
file2 = Ȟf�
And, wmaker crash. Why? because IMO the code used to remove items from the
HastTables (domain database) is wrong. It removes the item, but don't "removes
the hole", then the next search in the hashtable, returns the item in the
"hole", a memory "no-item" (trash, the " f"). The code is at WINGs/hashtable.c,
functions WMHashRemove() and deleteFromList(). Help is very appreciated.
Probably you can reproduce the problem renaming the defaultAppIcon.tiff image
after wmaker is up and launching a application without icon (declare a non
exist file in WMState file).
On the other hand, I think that there is a problem in the icon load, because
the icons exists:
kix@osaka:~/src/wmaker/wmaker-crm/src$ find ~kix/GNUstep -name
defaultAppIcon.tiff
/home/kix/GNUstep/Library/Icons/defaultAppIcon.tiff
kix@osaka:~/src/wmaker/wmaker-crm/src$ find /usr -name defaultAppIcon.tiff
/usr/local/share/WindowMaker/Icons/defaultAppIcon.tiff
But... wmaker is not including the full-path? Probably (I cannot check it),
wmaker is trying to use the icon in the database. The database contains
"GNUterm.tiff" and don't the full path... or probably I miss something.
Help is very appreciated.
Cheers,
kix
--- a/src/icon.c
+++ b/src/icon.c
@@ -644,25 +644,25 @@ static void get_pixmap_icon_from_default_icon(WIcon *icon
static RImage *get_default_image(WScreen *scr)
{
RImage *image = NULL;
- char *path, *file;
+ char *file = NULL;
/* Get the default icon */
file = wDefaultGetIconFile(NULL, NULL, True);
- if (file) {
- path = FindImage(wPreferences.icon_path, file);
- if (path) {
- image = RLoadImage(scr->rcontext, path, 0);
- if (!image)
- wwarning(_("could not load default icon \"%s\":
- file, RMessageForError(RErrorCode));
- wfree(path);
- } else {
- wwarning(_("could not find default icon \"%s\""), file)
- }
- }
- /* Validate the icon size */
- image = wIconValidateIconSize(image, wPreferences.icon_size);
+ printf("file1 = %s\n", file);
+
+ /* If file is NULL, get_rimage_from_file returns NULL */
+ image = get_rimage_from_file(scr, file, wPreferences.icon_size);
+
+ printf("image = %p\n", image);
+ printf("file2 = %s\n", file);
+
+ if (file && !image)
+ wwarning(_("could not load default icon \"%s\":%s"),
+ file, RMessageForError(RErrorCode));
+
+ if (file)
+ wfree(file);
--
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
--
To unsubscribe, send mail to [email protected].