From: Christophe CURIS <[email protected]>

As raised by Carlos R. Mafra and Doug Torrance, when an image is used in a
texture but the image cannot be loaded, there are some case where WPrefs
misbehaves.
This patch display a warning in every case where the image could not be
loaded, and always switch to black texture as a fallback, which was not the
case previously.

Signed-off-by: Christophe CURIS <[email protected]>
---
 WPrefs.app/Appearance.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c
index 9b42034..dc1d8c0 100644
--- a/WPrefs.app/Appearance.c
+++ b/WPrefs.app/Appearance.c
@@ -512,12 +512,16 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * 
texture, int width, int
                path = wfindfileinarray(GetObjectForKey("PixmapPath"), str);
                if (path) {
                        timage = RLoadImage(rc, path, 0);
-                       if (!timage) {
-                               wwarning("could not load file '%s': %s", path ? 
path : str, RMessageForError(RErrorCode));
-                               texture = 
WMCreatePropListFromDescription("(solid, black)");
-                               type = "solid";
-                       }
+                       if (!timage)
+                               wwarning("could not load file '%s': %s", path, 
RMessageForError(RErrorCode));
                        wfree(path);
+               } else {
+                       wwarning("could not find file '%s' for %s of texture", 
str, type);
+                       timage = NULL;
+               }
+               if (!timage) {
+                       texture = WMCreatePropListFromDescription("(solid, 
black)");
+                       type = "solid";
                }
        }
 
-- 
1.9.2


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

Reply via email to