On Sun, 24 Mar 2013 at 19:34:55 +0000, Carlos R. Mafra wrote:
> 
> I put some random icons there in order to test the WPrefs changes but
> I'm getting a segfault. I need to understand what's going on here but
> that does not invalidate the fact that the patch is broken wrt the icons.

Oh, I see. You already have values defined for

ClipAutoexpandDelay
ClipAutocollapseDelay
ClipAutoraiseDelay
ClipAutolowerDelay

in your own configuration file, right?

But if don't you get a segfault, because of this in showData() from
Docks.c

                value = GetStringForKey(autoDelayKeys[i]);
                WMSetTextFieldText(panel->autoDelayT[i], value);
                adjustButtonSelectionBasedOnValue(panel, i, value);
                
if value is NULL, adjustButtonSelectionBasedOnValue(panel, i, value)
will crash.

One should better make that function more robust (hint!),
but you should have default values for those options to avoid
this too.

With the patch below, which sets default values "0", I can at least
start testing your patch, but now I run out of time already :-(

diff --git a/WPrefs.app/Docks.c b/WPrefs.app/Docks.c
index 92f76eb..a28134b 100644
--- a/WPrefs.app/Docks.c
+++ b/WPrefs.app/Docks.c
@@ -273,6 +273,8 @@ static void showData(_Panel *panel)
        for (i = 0; i < 4; i++)
        {
                value = GetStringForKey(autoDelayKeys[i]);
+               if (!value)
+                       value = "0";
                WMSetTextFieldText(panel->autoDelayT[i], value);
                adjustButtonSelectionBasedOnValue(panel, i, value);
        }



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

Reply via email to