winspector: Don't use text input if NULL
authorRodolfo García Peñas (kix) <kix@kix.es>
Wed, 28 Nov 2012 21:50:51 +0000 (28 22:50 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Thu, 29 Nov 2012 09:30:25 +0000 (29 09:30 +0000)
This patch don't use the text input for the file if is empty.
The function should use the function to get the icon provided
by the client.

src/winspector.c

index 7e916e7..cd9250d 100644 (file)
@@ -736,7 +736,9 @@ static void applySettings(WMButton *button, InspectorPanel *panel)
                        file = NULL;
                }
 
-               if (WFLAGP(wwin, always_user_icon)) {
+               /* If file is NULL, the always_user_icon doesn't matter,
+                * because we need to read the icon from the window */
+               if (file && WFLAGP(wwin, always_user_icon)) {
                        /* Change icon image if the app is minimized */
                        if (wwin->icon)
                                wIconChangeImageFile(wwin->icon, file);