diff --git a/ChangeLog b/ChangeLog index 51ea2829..7ac9b71e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -53,6 +53,10 @@ Changes since version 0.64.0: mouse buttons: MouseLeftButtonAction, MouseMiddleButtonAction, MouseRightButtonAction and MouseWheelAction. They replace the above 3 removed options, but use a different semantic. More in NEWS. +- client supplied icons that were saved by Window Maker in the directory + ~/GNUstep/.AppInfo/WindowMaker/ will be recreated if missing when the + application starts. +- fixed a small memleak when the client supplied icon was extracted and saved. Changes since version 0.63.1: diff --git a/NEWS b/NEWS index 9ec77d97..2366e76b 100644 --- a/NEWS +++ b/NEWS @@ -55,6 +55,30 @@ Else you need to use WPrefs.app to bind the actions to the mouse buttons again to your old settings. Also if you want to change the mouse wheel behavior regarding workspaces you can now (use WPrefs.app to do this). +Client supplied icons +--------------------- + +Window Maker saves the client supplied icons in ~/GNUstep/.AppInfo/WindowMaker +in XPM format for later use when the app is no longer running (to have the +image to display for docked icons for example). + +Until recently the XPM images saved by Window Maker were incorrect, but a +recent fix in the code to save XPM's fixed them. But with this fix, all +previously saved XPM's in that directory are no longer readable (they give +wrong images on screen or fail to load). + +To avoid the need for the user to fix this by hand editing WMWindowAttributes +and removing all references to icons in ~/GNUstep/.AppInfo/WindowMaker which +can be annoying, new code was added to Window Maker to permit the regeneration +of images in ~/GNUstep/.AppInfo/WindowMaker if they are missing. + +With this addition, all you need to do to fix your old broken images, is to +delete all *.xpm files from ~/GNUstep/.AppInfo/WindowMaker. Next time the +application that is supplying an icon image will start the icon will be +recreated if missing, but this time it will be saved with the new XPM save +code which produces good XPM images. +All the rest of the process is transparent to the user. + --- 0.64.0 diff --git a/configure.in b/configure.in index 65dd571b..ba9c38ea 100644 --- a/configure.in +++ b/configure.in @@ -569,7 +569,7 @@ dnl ============== AC_ARG_ENABLE(hermes, [ --disable-hermes disable Hermes support for wrlib ], - hermes=$enableval, hermes=yes, hermes=no) + hermes=$enableval, hermes=yes) if test x$hermes = xyes; then WM_CHECK_LIB(Hermes, Hermes_ConverterRequest, []) @@ -579,6 +579,7 @@ if test x$hermes = xyes; then if test x$ac_cv_header_Hermes_Hermes_h = xyes; then GFXLIBS="$GFXLIBS -lHermes" AC_DEFINE(HAVE_HERMES) + hermes_support=yes fi fi fi @@ -1002,7 +1003,7 @@ echo "Installation path prefix: $prefix" echo "Installation path prefix for binaries: $_bindir" echo "Installation path for WPrefs.app: $wprefsdir" | sed -e 's|\$(prefix)|'"$prefix|" echo "Graphic format libraries: $supported_gfx" -if test x$hermes = xyes; then +if test x$hermes_support = xyes; then echo "Hermes support for wrlib enabled" fi echo "Sound support: $sound" diff --git a/src/application.c b/src/application.c index 5ceb56f0..eef1e7df 100644 --- a/src/application.c +++ b/src/application.c @@ -25,7 +25,11 @@ #include #include + +#include +#include #include +#include #include "WindowMaker.h" #include "menu.h" @@ -183,6 +187,7 @@ saveIconNameFor(char *iconPath, char *wm_instance, char *wm_class) PLRelease(val); } PLRelease(key); + PLRelease(iconk); if (val && !wPreferences.flags.noupdates) PLSave(dict, YES); @@ -398,12 +403,37 @@ wApplicationCreate(WScreen *scr, Window main_window) } if (wapp->app_icon) { - char *tmp; + char *tmp, *path; + struct stat dummy; + RImage *image; - /* if the displayed icon was supplied by the client, save the icon */ tmp = wDefaultGetIconFile(scr, wapp->app_icon->wm_instance, wapp->app_icon->wm_class, True); - if (!tmp) + + /* If the icon was saved by us from the client supplied icon, but is + * missing, recreate it. */ + if (tmp && strstr(tmp, ".AppInfo/WindowMaker")!=NULL && + stat(tmp, &dummy)!=0 && errno==ENOENT) { + wmessage(_("recreating missing icon '%s'"), tmp); + path = wIconStore(wapp->app_icon->icon); + if (path) { + wfree(path); + } + image = wDefaultGetImage(scr, wapp->app_icon->wm_instance, + wapp->app_icon->wm_class); + if (image) { + wIconChangeImage(wapp->app_icon->icon, image); + wAppIconPaint(wapp->app_icon); + /* TODO: + * wIconChangeImage() should be rewriten to use retain/release + * The way it is now is too confusing about where the icon is + * finally released. -Dan */ + /* --this is wrong at the moment-- RReleaseImage(image);*/ + } + } + + /* if the displayed icon was supplied by the client, save the icon */ + if (!tmp) extractClientIcon(wapp->app_icon); } diff --git a/wrlib/ChangeLog b/wrlib/ChangeLog index 76875e15..da609b3b 100644 --- a/wrlib/ChangeLog +++ b/wrlib/ChangeLog @@ -3,7 +3,6 @@ will be removed in a future release because it no longer fits with the semantics. Will be kept for a while to allow a smoother transition. More about in NEWS - - Fixed crashing for Pseudocolor visuals with BestMatchRendering - Small speed improvement for 24 and 32 bpp, if internal converter is used - Small speed improvement for generating gradients.