From b9caaa8729fe39848308ce13e5a140f18f0b9102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Tue, 8 Jan 2013 16:58:04 +0100 Subject: [PATCH] WINGs: New function W_setconf_doubleClickDelay The new function W_setconf_doubleClickDelay() sets the value for WPreferences.W_setconf_doubleClickDelay(), therefore the private data of WPreferences struct is not used. This call is used at defaults.c to set the doubleClickDelay(). --- WINGs/WINGs/WINGs.h | 1 + WINGs/configuration.c | 5 +++++ src/defaults.c | 14 ++------------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/WINGs/WINGs/WINGs.h b/WINGs/WINGs/WINGs.h index d9aba8c4..5682dfaa 100644 --- a/WINGs/WINGs/WINGs.h +++ b/WINGs/WINGs/WINGs.h @@ -1833,6 +1833,7 @@ WMFont* WMGetFontPanelFont(WMFontPanel *panel); /* ---[ WINGs/configuration.c ]------------------------------------------- */ unsigned W_getconf_mouseWheelUp(void); unsigned W_getconf_mouseWheelDown(void); +void W_setconf_doubleClickDelay(int value); #ifdef __cplusplus } diff --git a/WINGs/configuration.c b/WINGs/configuration.c index 2f56aa89..8e53ba6e 100644 --- a/WINGs/configuration.c +++ b/WINGs/configuration.c @@ -125,3 +125,8 @@ unsigned W_getconf_mouseWheelDown(void) { return WINGsConfiguration.mouseWheelDown; } + +void W_setconf_doubleClickDelay(int value) +{ + WINGsConfiguration.doubleClickDelay = value; +} diff --git a/src/defaults.c b/src/defaults.c index 13c5d692..f04e9be5 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -2985,22 +2985,12 @@ static int setModifierKeyLabels(WScreen * scr, WDefaultEntry * entry, WMPropList return 0; } -/* - * Very ugly kluge. - * Need access to the double click variables, so that all widgets in - * wmaker panels will have the same dbl-click values. - * TODO: figure a better way of dealing with it. - */ -#include - -static int setDoubleClick(WScreen * scr, WDefaultEntry * entry, int *value, void *foo) +static int setDoubleClick(WScreen *scr, WDefaultEntry *entry, int *value, void *foo) { - extern _WINGsConfiguration WINGsConfiguration; - if (*value <= 0) *(int *)foo = 1; - WINGsConfiguration.doubleClickDelay = *value; + W_setconf_doubleClickDelay(*value); return 0; }