Summary: WindowMaker no longer picking up icon...
Submitted by: gcasa
Submitted on: Thu 19 Feb 2009 10:30:54 AM EST
Severity: 3 - Normal
Item Group: Bug
Assigned to: gcasa
Discussion Lock: Any
1) Start an app that is not on the dock.
2) Drag it's miniwindow to the dock
3) stop the app
ACTUAL: The application's icon will not be on the dock.
EXPECTED: The application icon should be on the dock.
NOTE: This is likely due to recent changes made by myself and Richard. I
made a change to make certain that the icon size would be adjusted to the
proper size for the icon setting in WindowMaker and Richard made a change to
avoid some X-windows errors since the code may have been trying to access the
size of the miniwindow prior to the miniwindow appearing.
where this moves the call:
[self setApplicationIconImage: image];
after the call to _appIconInit;
in back/Source/x11/XGServerWindow.m -orderWindow:::
_createAppIconPixmaps (where windowmaker gets the icon) is only called once
at the ordering in of the icon window
and _appIconInit calls -orderFrontRegardless.
iirc windowmaker might do the same looking for the app-icon once when it
mapping, and then caching it, which is probably why i didn't add some
[GSCurrentServer() _setAppIconImage:] but it might be worth trying
I tried here with a couple of applications. They all "dock" in the dock with
the three dots, some will retain the icon, some get a generic icon... it is
not "size" related either, since for example PRICE retains its big 64x64 icon,
battery monitor will not. SystemPreferences works...
Riccardo, it is possible that some apps icons were cached by windowmaker
before the bug appeared, I believe in
~/GNUstep/Library/WindowMaker/CachedPixmaps before this bug appeared which
could be why some apps get this behaviour and others do not, to reliably
reproduce this you may need to remove the cached icon...
I think the change that Matt pointed to is really the cause of the problem.
Looks like Richard made that change in responce to some change by Greg. And I
have problems understanding that first change.
To me it looks like we are restricting the size of the icon window twice.
Once when setting it as the application icon and another time when we set a
copy as the image of the icon view. Are they both needed?
Also the scaling computation here is unclear to me. I think it is best to
remove all unneeded code here first and then sort out the order of things.
yuo don't understand the scaling in scaledIconSizeForSize(imageSize)?
basically it tries to keep the same aspect ratio
assuming the icon is made for a 64x64 icon window
and the icon is some random size like 48x56
so say windowmaker returns a 32x32 iconSize
we scale the icon down by
48 * 32 / 64 = 24;
56 * 32 / 64 = 28;
so our new icon is 24x28
we do this on a copy because other places (exception panels, file open
dialogs etc, use the -applicationIconImage:
and i felt it was best to have -applicationIconImage: return what was set in
-setApplicationIconImage: and keep a private scaled copy for the actual
I would say make scaledIconSizeForSize() could just not scale up, only scale
down, and then maybe -setImage: could return the scaled copy or provide an
accessor method in NSAppIconView for the mini window stuff below it?
I've removed the need for the setApplicationIconImage: method to reference
the window, so I've put it before the call to _appIconInit which calls the
_createAppIconPixmaps method. This solves the issue.
Please take a look and let me know if there's any issue with my change. it
does appear to work for me.