1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

Make the clip's auto-delays configurable

The options are ClipAutoraiseDelay, ClipAutolowerDelay, ClipAutoexpandDelay, ClipAutocollapseDelay

The default values are weird but merely represent the previously
hard-coded ones. They are repeated in Defaults/WindowMaker to avoid a
WPrefs crash (but it's a good idea to make them "visible", too)

WPrefs change coming up
This commit is contained in:
Daniel Déchelotte
2013-04-12 01:42:33 +02:00
committed by Carlos R. Mafra
parent 6f44be87fc
commit d24cbc79ee
5 changed files with 22 additions and 18 deletions

View File

@@ -131,4 +131,8 @@
MenuTitleBack = (solid, black);
MenuTextBack = (solid, "rgb:aa/aa/aa");
IconBack = (dgradient, "rgb:a6/a6/b6", "rgb:51/55/61");
ClipAutocollapseDelay = 1000;
ClipAutolowerDelay = 1000;
ClipAutoexpandDelay = 600;
ClipAutoraiseDelay = 600;
}

View File

@@ -419,6 +419,12 @@ typedef struct WPreferences {
char cycle_active_head_only; /* Cycle only windows on the active head */
char cycle_ignore_minimized; /* Ignore minimized windows when cycling */
/* All delays here are in ms. 0 means instant auto-action. */
int clip_auto_raise_delay; /* Delay after which the clip will be raised when entered */
int clip_auto_lower_delay; /* Delay after which the clip will be lowered when leaved */
int clip_auto_expand_delay; /* Delay after which the clip will expand when entered */
int clip_auto_collapse_delay; /* Delay after which the clip will collapse when leaved */
RImage *swtileImage;
RImage *swbackImage[9];

View File

@@ -394,6 +394,14 @@ WDefaultEntry optionList[] = {
&wPreferences.do_not_make_appicons_bounce, getBool, NULL, NULL, NULL},
{"DoubleClickTime", "250", (void *)&wPreferences.dblclick_time,
&wPreferences.dblclick_time, getInt, setDoubleClick, NULL, NULL},
{"ClipAutoraiseDelay", "600", NULL,
&wPreferences.clip_auto_raise_delay, getInt, NULL, NULL, NULL},
{"ClipAutolowerDelay", "1000", NULL,
&wPreferences.clip_auto_lower_delay, getInt, NULL, NULL, NULL},
{"ClipAutoexpandDelay", "600", NULL,
&wPreferences.clip_auto_expand_delay, getInt, NULL, NULL, NULL},
{"ClipAutocollapseDelay", "1000", NULL,
&wPreferences.clip_auto_collapse_delay, getInt, NULL, NULL, NULL},
{"AlignSubmenus", "NO", NULL,
&wPreferences.align_menus, getBool, NULL, NULL, NULL},
{"ViKeyMenus", "NO", NULL,

View File

@@ -3792,7 +3792,7 @@ static void clipEnterNotify(WObjDescriptor *desc, XEvent *event)
dock->auto_lower_magic = NULL;
}
if (dock->auto_raise_lower && !dock->auto_raise_magic)
dock->auto_raise_magic = WMAddTimerHandler(AUTO_RAISE_DELAY, clipAutoRaise, (void *)dock);
dock->auto_raise_magic = WMAddTimerHandler(wPreferences.clip_auto_raise_delay, clipAutoRaise, (void *)dock);
/* The auto expand/collapse code */
if (dock->auto_collapse_magic) {
@@ -3800,7 +3800,7 @@ static void clipEnterNotify(WObjDescriptor *desc, XEvent *event)
dock->auto_collapse_magic = NULL;
}
if (dock->auto_collapse && !dock->auto_expand_magic)
dock->auto_expand_magic = WMAddTimerHandler(AUTO_EXPAND_DELAY, clipAutoExpand, (void *)dock);
dock->auto_expand_magic = WMAddTimerHandler(wPreferences.clip_auto_expand_delay, clipAutoExpand, (void *)dock);
}
static void clipLeave(WDock *dock)
@@ -3832,14 +3832,14 @@ static void clipLeave(WDock *dock)
dock->auto_raise_magic = NULL;
}
if (dock->auto_raise_lower && !dock->auto_lower_magic)
dock->auto_lower_magic = WMAddTimerHandler(AUTO_LOWER_DELAY, clipAutoLower, (void *)dock);
dock->auto_lower_magic = WMAddTimerHandler(wPreferences.clip_auto_lower_delay, clipAutoLower, (void *)dock);
if (dock->auto_expand_magic) {
WMDeleteTimerHandler(dock->auto_expand_magic);
dock->auto_expand_magic = NULL;
}
if (dock->auto_collapse && !dock->auto_collapse_magic)
dock->auto_collapse_magic = WMAddTimerHandler(AUTO_COLLAPSE_DELAY, clipAutoCollapse, (void *)dock);
dock->auto_collapse_magic = WMAddTimerHandler(wPreferences.clip_auto_collapse_delay, clipAutoCollapse, (void *)dock);
}
static void clipLeaveNotify(WObjDescriptor *desc, XEvent *event)

View File

@@ -301,20 +301,6 @@
* a docked icon must be dragged out to detach it */
#define DOCK_DETTACH_THRESHOLD 3
/* Delay (in ms) after which the clip will autocollapse when leaved */
#define AUTO_COLLAPSE_DELAY 1000
/* Delay (in ms) after which the clip will autoexpand when entered.
* Set this to zero if you want instant expanding. */
#define AUTO_EXPAND_DELAY 600
/* Delay (in ms) after which the clip will be lowered when leaved */
#define AUTO_LOWER_DELAY 1000
/* Delay (in ms) after which the clip will be raised when entered.
* Set this to zero if you want instant raise. */
#define AUTO_RAISE_DELAY 600
/* Max. number of icons the dock and clip can have */
#define DOCK_MAX_ICONS 32