allow to choose the number of blink for urgent task
git-svn-id: http://tint2.googlecode.com/svn/trunk@119 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
533ab08523
commit
4c5408d5fd
5 changed files with 25 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
2009-06-20
|
||||||
|
- 'urgent_nb_of_blink' allow to choose the number of blink
|
||||||
|
|
||||||
2009-06-19
|
2009-06-19
|
||||||
- change systray code. fixed issue 91.
|
- change systray code. fixed issue 91.
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,7 @@ void init_config()
|
||||||
panel_config = calloc(1, sizeof(Panel));
|
panel_config = calloc(1, sizeof(Panel));
|
||||||
// window manager's menu default value == false
|
// window manager's menu default value == false
|
||||||
wm_menu = 0;
|
wm_menu = 0;
|
||||||
|
max_tick_urgent = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -318,6 +319,8 @@ void add_entry (char *key, char *value)
|
||||||
}
|
}
|
||||||
else if (strcmp (key, "wm_menu") == 0)
|
else if (strcmp (key, "wm_menu") == 0)
|
||||||
wm_menu = atoi (value);
|
wm_menu = atoi (value);
|
||||||
|
else if (strcmp (key, "urgent_nb_of_blink") == 0)
|
||||||
|
max_tick_urgent = (atoi (value) * 2) + 1;
|
||||||
|
|
||||||
/* Battery */
|
/* Battery */
|
||||||
#ifdef ENABLE_BATTERY
|
#ifdef ENABLE_BATTERY
|
||||||
|
|
|
@ -47,6 +47,8 @@ int panel_refresh;
|
||||||
Task *task_active;
|
Task *task_active;
|
||||||
Task *task_drag;
|
Task *task_drag;
|
||||||
Task *task_urgent;
|
Task *task_urgent;
|
||||||
|
int tick_urgent;
|
||||||
|
int max_tick_urgent;
|
||||||
|
|
||||||
Panel *panel1 = 0;
|
Panel *panel1 = 0;
|
||||||
int nb_panel;
|
int nb_panel;
|
||||||
|
|
|
@ -47,6 +47,8 @@ extern int panel_refresh;
|
||||||
extern Task *task_active;
|
extern Task *task_active;
|
||||||
extern Task *task_drag;
|
extern Task *task_drag;
|
||||||
extern Task *task_urgent;
|
extern Task *task_urgent;
|
||||||
|
extern int tick_urgent;
|
||||||
|
extern int max_tick_urgent;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
14
src/tint.c
14
src/tint.c
|
@ -390,6 +390,7 @@ void event_property_notify (XEvent *e)
|
||||||
else if (at == server.atom._NET_WM_STATE) {
|
else if (at == server.atom._NET_WM_STATE) {
|
||||||
if (window_is_urgent (win)) {
|
if (window_is_urgent (win)) {
|
||||||
task_urgent = tsk;
|
task_urgent = tsk;
|
||||||
|
tick_urgent = 0;
|
||||||
time_precision = 1;
|
time_precision = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -510,8 +511,11 @@ void event_timer()
|
||||||
|
|
||||||
// urgent task
|
// urgent task
|
||||||
if (task_urgent) {
|
if (task_urgent) {
|
||||||
|
if (tick_urgent < max_tick_urgent) {
|
||||||
task_urgent->area.is_active = !task_urgent->area.is_active;
|
task_urgent->area.is_active = !task_urgent->area.is_active;
|
||||||
task_urgent->area.redraw = 1;
|
task_urgent->area.redraw = 1;
|
||||||
|
tick_urgent++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// update battery
|
// update battery
|
||||||
|
@ -547,8 +551,16 @@ int main (int argc, char *argv[])
|
||||||
load_config:
|
load_config:
|
||||||
i = 0;
|
i = 0;
|
||||||
init_config();
|
init_config();
|
||||||
if (c != -1)
|
if (c != -1) {
|
||||||
i = config_read_file (optarg);
|
i = config_read_file (optarg);
|
||||||
|
c = getopt (argc, argv, "j:");
|
||||||
|
if (c != -1) {
|
||||||
|
// usage: tint2 [-c] <config_file> -j <jpeg_file> for internal use
|
||||||
|
printf("jpeg file %s\n", optarg);
|
||||||
|
cleanup();
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!i)
|
if (!i)
|
||||||
i = config_read ();
|
i = config_read ();
|
||||||
if (!i) {
|
if (!i) {
|
||||||
|
|
Loading…
Reference in a new issue