summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/default/e.src1
-rw-r--r--config/mobile/e.src1
-rw-r--r--config/standard/e.src1
-rw-r--r--data/themes/default.edc30
-rw-r--r--src/bin/e_border.c1
-rw-r--r--src/bin/e_config.c2
-rw-r--r--src/bin/e_config.h6
-rw-r--r--src/bin/e_exec.c145
-rw-r--r--src/bin/e_exec.h15
-rw-r--r--src/modules/conf_applications/e_int_config_deskenv.c26
-rw-r--r--src/modules/ibar/e_mod_config.c29
-rw-r--r--src/modules/ibar/e_mod_main.c76
-rw-r--r--src/modules/ibar/e_mod_main.h1
13 files changed, 277 insertions, 57 deletions
diff --git a/config/default/e.src b/config/default/e.src
index 0598c4c85..947b9074e 100644
--- a/config/default/e.src
+++ b/config/default/e.src
@@ -525,6 +525,7 @@ group "E_Config" struct {
525 value "update.later" uchar: 0; 525 value "update.later" uchar: 0;
526 value "xkb.only_label" int: 0; 526 value "xkb.only_label" int: 0;
527 value "xkb.default_model" string: "default"; 527 value "xkb.default_model" string: "default";
528 value "exe_always_single_instance" uchar: 0;
528 value "powersave.none" double: 0.25; 529 value "powersave.none" double: 0.25;
529 value "powersave.low" double: 5.0; 530 value "powersave.low" double: 5.0;
530 value "powersave.medium" double: 60.0; 531 value "powersave.medium" double: 60.0;
diff --git a/config/mobile/e.src b/config/mobile/e.src
index 4f74b74d5..7fcd6b4b6 100644
--- a/config/mobile/e.src
+++ b/config/mobile/e.src
@@ -1792,4 +1792,5 @@ group "E_Config" struct {
1792 } 1792 }
1793 value "xkb.only_label" int: 0; 1793 value "xkb.only_label" int: 0;
1794 value "xkb.default_model" string: "default"; 1794 value "xkb.default_model" string: "default";
1795 value "exe_always_single_instance" uchar: 1;
1795} 1796}
diff --git a/config/standard/e.src b/config/standard/e.src
index 98cd62a49..ebc40f93f 100644
--- a/config/standard/e.src
+++ b/config/standard/e.src
@@ -2029,4 +2029,5 @@ group "E_Config" struct {
2029 } 2029 }
2030 value "xkb.only_label" int: 0; 2030 value "xkb.only_label" int: 0;
2031 value "xkb.default_model" string: "default"; 2031 value "xkb.default_model" string: "default";
2032 value "exe_always_single_instance" uchar: 0;
2032} 2033}
diff --git a/data/themes/default.edc b/data/themes/default.edc
index ceda56f65..e6d9e147c 100644
--- a/data/themes/default.edc
+++ b/data/themes/default.edc
@@ -13432,22 +13432,22 @@ CONNMAN_ICON(ethernet)
13432 name: "item_clip"; 13432 name: "item_clip";
13433 type: RECT; 13433 type: RECT;
13434 mouse_events: 0; 13434 mouse_events: 0;
13435 description { 13435 description { state: "default" 0.0;
13436 state: "default" 0.0;
13437 color: 255 255 255 255; 13436 color: 255 255 255 255;
13438 } 13437 }
13438 description { state: "disabled" 0.0;
13439 color: 255 255 255 64;
13440 }
13439 } 13441 }
13440 part { 13442 part {
13441 name: "e.swallow.content"; 13443 name: "e.swallow.content";
13442 type: SWALLOW; 13444 type: SWALLOW;
13443 clip_to: "item_clip"; 13445 clip_to: "item_clip";
13444 description { 13446 description { state: "default" 0.0;
13445 state: "default" 0.0;
13446 rel1.offset: 2 2; 13447 rel1.offset: 2 2;
13447 rel2.offset: -3 -3; 13448 rel2.offset: -3 -3;
13448 } 13449 }
13449 description { 13450 description { state: "bigger" 0.0;
13450 state: "bigger" 0.0;
13451 } 13451 }
13452 } 13452 }
13453 part { 13453 part {
@@ -13529,12 +13529,18 @@ CONNMAN_ICON(ethernet)
13529 } 13529 }
13530 programs { 13530 programs {
13531 program { 13531 program {
13532 name: "hover_in"; 13532 name: "starting";
13533 signal: "mouse,in"; 13533 signal: "e,state,starting";
13534 source: "over"; 13534 source: "e";
13535 action: STATE_SET "bigger" 0.0; 13535 action: STATE_SET "disabled" 0.0;
13536 transition: LINEAR 0.1; 13536 target: "item_clip";
13537 target: "e.swallow.content"; 13537 }
13538 program {
13539 name: "started";
13540 signal: "e,state,started";
13541 source: "e";
13542 action: STATE_SET "default" 0.0;
13543 target: "item_clip";
13538 } 13544 }
13539 program { 13545 program {
13540 name: "hover_out"; 13546 name: "hover_out";
diff --git a/src/bin/e_border.c b/src/bin/e_border.c
index 039bda332..7ac2298d8 100644
--- a/src/bin/e_border.c
+++ b/src/bin/e_border.c
@@ -7553,6 +7553,7 @@ _e_border_eval0(E_Border *bd)
7553 desk = e_desk_at_xy_get(bd->zone, inst->desk_x, 7553 desk = e_desk_at_xy_get(bd->zone, inst->desk_x,
7554 inst->desk_y); 7554 inst->desk_y);
7555 if (desk) e_border_desk_set(bd, desk); 7555 if (desk) e_border_desk_set(bd, desk);
7556 e_exec_instance_found(inst);
7556 } 7557 }
7557 7558
7558 if (e_config->window_grouping) // FIXME: We may want to make the border "urgent" so that the user knows it appeared. 7559 if (e_config->window_grouping) // FIXME: We may want to make the border "urgent" so that the user knows it appeared.
diff --git a/src/bin/e_config.c b/src/bin/e_config.c
index 9372b86ae..e43675c6a 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -932,6 +932,8 @@ e_config_init(void)
932 E_CONFIG_VAL(D, T, xkb.only_label, INT); 932 E_CONFIG_VAL(D, T, xkb.only_label, INT);
933 E_CONFIG_VAL(D, T, xkb.default_model, STR); 933 E_CONFIG_VAL(D, T, xkb.default_model, STR);
934 //E_CONFIG_VAL(D, T, xkb.cur_group, INT); 934 //E_CONFIG_VAL(D, T, xkb.cur_group, INT);
935
936 E_CONFIG_VAL(D, T, exe_always_single_instance, UCHAR);
935 e_config_load(); 937 e_config_load();
936 938
937 e_config_save_queue(); 939 e_config_save_queue();
diff --git a/src/bin/e_config.h b/src/bin/e_config.h
index 8814c429b..751880011 100644
--- a/src/bin/e_config.h
+++ b/src/bin/e_config.h
@@ -260,12 +260,12 @@ struct _E_Config
260 double thumbscroll_momentum_threshhold; // GUI 260 double thumbscroll_momentum_threshhold; // GUI
261 double thumbscroll_friction; // GUI 261 double thumbscroll_friction; // GUI
262 262
263 Eina_Bool filemanager_single_click; // GUI 263 unsigned char filemanager_single_click; // GUI
264 int device_desktop; // GUI 264 int device_desktop; // GUI
265 int device_auto_mount; // GUI 265 int device_auto_mount; // GUI
266 int device_auto_open; // GUI 266 int device_auto_open; // GUI
267 Efm_Mode device_detect_mode; /* not saved, display-only */ 267 Efm_Mode device_detect_mode; /* not saved, display-only */
268 Eina_Bool filemanager_copy; // GUI 268 unsigned char filemanager_copy; // GUI
269 269
270 struct 270 struct
271 { 271 {
@@ -386,6 +386,8 @@ struct _E_Config
386 const char *default_model; 386 const char *default_model;
387 int cur_group; 387 int cur_group;
388 } xkb; 388 } xkb;
389
390 unsigned char exe_always_single_instance;
389}; 391};
390 392
391struct _E_Config_Desklock_Background 393struct _E_Config_Desklock_Background
diff --git a/src/bin/e_exec.c b/src/bin/e_exec.c
index c48fbbe47..cedcdeefb 100644
--- a/src/bin/e_exec.c
+++ b/src/bin/e_exec.c
@@ -11,6 +11,7 @@
11 11
12typedef struct _E_Exec_Launch E_Exec_Launch; 12typedef struct _E_Exec_Launch E_Exec_Launch;
13typedef struct _E_Exec_Search E_Exec_Search; 13typedef struct _E_Exec_Search E_Exec_Search;
14typedef struct _E_Exec_Watch E_Exec_Watch;
14 15
15struct _E_Exec_Launch 16struct _E_Exec_Launch
16{ 17{
@@ -21,10 +22,18 @@ struct _E_Exec_Launch
21struct _E_Exec_Search 22struct _E_Exec_Search
22{ 23{
23 E_Exec_Instance *inst; 24 E_Exec_Instance *inst;
25 Efreet_Desktop *desktop;
24 int startup_id; 26 int startup_id;
25 pid_t pid; 27 pid_t pid;
26}; 28};
27 29
30struct _E_Exec_Watch
31{
32 void (*func) (void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type);
33 const void *data;
34 Eina_Bool delete_me : 1;
35};
36
28struct _E_Config_Dialog_Data 37struct _E_Config_Dialog_Data
29{ 38{
30 Efreet_Desktop *desktop; 39 Efreet_Desktop *desktop;
@@ -99,18 +108,36 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec,
99{ 108{
100 E_Exec_Launch *launch; 109 E_Exec_Launch *launch;
101 E_Exec_Instance *inst = NULL; 110 E_Exec_Instance *inst = NULL;
102 const char *single = NULL;
103 111
104 if ((!desktop) && (!exec)) return NULL; 112 if ((!desktop) && (!exec)) return NULL;
105 113
106 if (desktop) 114 if (desktop)
107 { 115 {
116 const char *single;
117
108 single = eina_hash_find(desktop->x, "X-Enlightenment-Single-Instance"); 118 single = eina_hash_find(desktop->x, "X-Enlightenment-Single-Instance");
109 if (single) 119 if ((single) ||
120 (e_config->exe_always_single_instance))
110 { 121 {
111 if ((!strcasecmp(single, "true")) || 122 Eina_Bool dosingle = EINA_FALSE;
112 (!strcasecmp(single, "yes"))|| 123
113 (!strcasecmp(single, "1"))) 124 // first take system config for always single instance if set
125 if (e_config->exe_always_single_instance) dosingle = EINA_TRUE;
126
127 // and now let desktop file override it
128 if (single)
129 {
130 if ((!strcasecmp(single, "true")) ||
131 (!strcasecmp(single, "yes"))||
132 (!strcasecmp(single, "1")))
133 dosingle = EINA_TRUE;
134 else if ((!strcasecmp(single, "false")) ||
135 (!strcasecmp(single, "no"))||
136 (!strcasecmp(single, "0")))
137 dosingle = EINA_FALSE;
138 }
139
140 if (dosingle)
114 { 141 {
115 Eina_List *l; 142 Eina_List *l;
116 E_Border *bd; 143 E_Border *bd;
@@ -121,7 +148,8 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec,
121 { 148 {
122 if (bd) 149 if (bd)
123 { 150 {
124 if (!bd->focused) e_border_activate(bd, EINA_TRUE); 151 if (!bd->focused)
152 e_border_activate(bd, EINA_TRUE);
125 else e_border_raise(bd); 153 else e_border_raise(bd);
126 return NULL; 154 return NULL;
127 } 155 }
@@ -166,6 +194,7 @@ e_exec_startup_id_pid_instance_find(int id, pid_t pid)
166 E_Exec_Search search; 194 E_Exec_Search search;
167 195
168 search.inst = NULL; 196 search.inst = NULL;
197 search.desktop = NULL;
169 search.startup_id = id; 198 search.startup_id = id;
170 search.pid = pid; 199 search.pid = pid;
171 eina_hash_foreach(e_exec_instances, _e_exec_startup_id_pid_find, &search); 200 eina_hash_foreach(e_exec_instances, _e_exec_startup_id_pid_find, &search);
@@ -182,6 +211,87 @@ e_exec_startup_id_pid_find(int id, pid_t pid)
182 return inst->desktop; 211 return inst->desktop;
183} 212}
184 213
214EAPI E_Exec_Instance *
215e_exec_startup_desktop_instance_find(Efreet_Desktop *desktop)
216{
217 E_Exec_Search search;
218
219 search.inst = NULL;
220 search.desktop = desktop;
221 search.startup_id = 0;
222 search.pid = 0;
223 eina_hash_foreach(e_exec_instances, _e_exec_startup_id_pid_find, &search);
224 return search.inst;
225}
226
227static void
228_e_exe_instance_watchers_call(E_Exec_Instance *inst, E_Exec_Watch_Type type)
229{
230 E_Exec_Watch *iw;
231 Eina_List *l, *ln;
232
233 inst->walking++;
234 EINA_LIST_FOREACH(inst->watchers, l, iw)
235 {
236 if (iw->func) iw->func((void *)(iw->data), inst, type);
237 }
238 inst->walking--;
239 if (inst->walking == 0)
240 {
241 EINA_LIST_FOREACH_SAFE(inst->watchers, l, ln, iw)
242 {
243 if (iw->delete_me)
244 {
245 inst->watchers = eina_list_remove_list(inst->watchers, l);
246 free(iw);
247 }
248 }
249 }
250}
251
252EAPI void
253e_exec_instance_found(E_Exec_Instance *inst)
254{
255 _e_exe_instance_watchers_call(inst, E_EXEC_WATCH_STARTED);
256}
257
258EAPI void
259e_exec_instance_watcher_add(E_Exec_Instance *inst, void (*func) (void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type), const void *data)
260{
261 E_Exec_Watch *iw;
262
263 iw = E_NEW(E_Exec_Watch, 1);
264 if (!iw) return;
265 iw->func = func;
266 iw->data = data;
267 inst->watchers = eina_list_append(inst->watchers, iw);
268}
269
270EAPI void
271e_exec_instance_watcher_del(E_Exec_Instance *inst, void (*func) (void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type), const void *data)
272{
273 E_Exec_Watch *iw;
274 Eina_List *l, *ln;
275
276 EINA_LIST_FOREACH_SAFE(inst->watchers, l, ln, iw)
277 {
278 if ((iw->func == func) && (iw->data == data))
279 {
280 if (inst->walking == 0)
281 {
282 inst->watchers = eina_list_remove_list(inst->watchers, l);
283 free(iw);
284 return;
285 }
286 else
287 {
288 iw->delete_me = EINA_TRUE;
289 return;
290 }
291 }
292 }
293}
294
185/* local subsystem functions */ 295/* local subsystem functions */
186static E_Exec_Instance * 296static E_Exec_Instance *
187_e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining) 297_e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
@@ -407,6 +517,7 @@ _e_exec_cb_expire_timer(void *data)
407 e_exec_start_pending = eina_list_remove(e_exec_start_pending, 517 e_exec_start_pending = eina_list_remove(e_exec_start_pending,
408 inst->desktop); 518 inst->desktop);
409 inst->expire_timer = NULL; 519 inst->expire_timer = NULL;
520 _e_exe_instance_watchers_call(inst, E_EXEC_WATCH_TIMEOUT);
410 return ECORE_CALLBACK_CANCEL; 521 return ECORE_CALLBACK_CANCEL;
411} 522}
412 523
@@ -414,7 +525,11 @@ static void
414_e_exec_instance_free(E_Exec_Instance *inst) 525_e_exec_instance_free(E_Exec_Instance *inst)
415{ 526{
416 Eina_List *instances; 527 Eina_List *instances;
417 528 E_Exec_Watch *iw;
529
530 _e_exe_instance_watchers_call(inst, E_EXEC_WATCH_STOPPED);
531 EINA_LIST_FREE(inst->watchers, iw) free(iw);
532
418 if (inst->key) 533 if (inst->key)
419 { 534 {
420 instances = eina_hash_find(e_exec_instances, inst->key); 535 instances = eina_hash_find(e_exec_instances, inst->key);
@@ -435,13 +550,14 @@ _e_exec_instance_free(E_Exec_Instance *inst)
435 if (inst->desktop) efreet_desktop_free(inst->desktop); 550 if (inst->desktop) efreet_desktop_free(inst->desktop);
436 free(inst); 551 free(inst);
437} 552}
438 553/*
439static Eina_Bool 554static Eina_Bool
440_e_exec_cb_instance_finish(void *data) 555_e_exec_cb_instance_finish(void *data)
441{ 556{
442 _e_exec_instance_free(data); 557 _e_exec_instance_free(data);
443 return ECORE_CALLBACK_CANCEL; 558 return ECORE_CALLBACK_CANCEL;
444} 559}
560*/
445 561
446static Eina_Bool 562static Eina_Bool
447_e_exec_cb_exit(void *data __UNUSED__, int type __UNUSED__, void *event) 563_e_exec_cb_exit(void *data __UNUSED__, int type __UNUSED__, void *event)
@@ -509,14 +625,17 @@ _e_exec_cb_exit(void *data __UNUSED__, int type __UNUSED__, void *event)
509 } 625 }
510 } 626 }
511 627
512 /* maybe better 1 minute? it might be openoffice */ 628/* scripts that fork off children with & break child tracking... but this hack
513 if (ecore_time_get() - inst->launch_time < 2.0) 629 * also breaks apps that handle single-instance themselves */
630/*
631 if ((ecore_time_get() - inst->launch_time) < 2.0)
514 { 632 {
515 inst->exe = NULL; 633 inst->exe = NULL;
516 if (inst->expire_timer) ecore_timer_del(inst->expire_timer); 634 if (inst->expire_timer) ecore_timer_del(inst->expire_timer);
517 inst->expire_timer = ecore_timer_add(e_config->exec.expire_timeout, _e_exec_cb_instance_finish, inst); 635 inst->expire_timer = ecore_timer_add(e_config->exec.expire_timeout, _e_exec_cb_instance_finish, inst);
518 } 636 }
519 else 637 else
638 */
520 _e_exec_instance_free(inst); 639 _e_exec_instance_free(inst);
521 640
522 return ECORE_CALLBACK_PASS_ON; 641 return ECORE_CALLBACK_PASS_ON;
@@ -532,8 +651,12 @@ _e_exec_startup_id_pid_find(const Eina_Hash *hash __UNUSED__, const void *key __
532 search = data; 651 search = data;
533 EINA_LIST_FOREACH(value, l, inst) 652 EINA_LIST_FOREACH(value, l, inst)
534 { 653 {
535 if (((search->startup_id > 0) && 654 if (((search->desktop) &&
655 (search->desktop == inst->desktop)) ||
656
657 ((search->startup_id > 0) &&
536 (search->startup_id == inst->startup_id)) || 658 (search->startup_id == inst->startup_id)) ||
659
537 ((inst->exe) && (search->pid > 1) && 660 ((inst->exe) && (search->pid > 1) &&
538 (search->pid == ecore_exe_pid_get(inst->exe)))) 661 (search->pid == ecore_exe_pid_get(inst->exe))))
539 { 662 {
diff --git a/src/bin/e_exec.h b/src/bin/e_exec.h
index 488c6355e..84378aa1c 100644
--- a/src/bin/e_exec.h
+++ b/src/bin/e_exec.h
@@ -17,15 +17,26 @@ struct _E_Exec_Instance
17 int screen; 17 int screen;
18 int desk_x, desk_y; 18 int desk_x, desk_y;
19 int used; 19 int used;
20 int walking;
21 Eina_List *watchers;
20}; 22};
21 23
24typedef enum
25{
26 E_EXEC_WATCH_STARTED,
27 E_EXEC_WATCH_STOPPED,
28 E_EXEC_WATCH_TIMEOUT
29} E_Exec_Watch_Type;
30
22EINTERN int e_exec_init(void); 31EINTERN int e_exec_init(void);
23EINTERN int e_exec_shutdown(void); 32EINTERN int e_exec_shutdown(void);
24EAPI E_Exec_Instance *e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method); 33EAPI E_Exec_Instance *e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method);
25
26EAPI E_Exec_Instance *e_exec_startup_id_pid_instance_find(int id, pid_t pid); 34EAPI E_Exec_Instance *e_exec_startup_id_pid_instance_find(int id, pid_t pid);
27EAPI Efreet_Desktop *e_exec_startup_id_pid_find(int startup_id, pid_t pid); 35EAPI Efreet_Desktop *e_exec_startup_id_pid_find(int startup_id, pid_t pid);
28 36EAPI E_Exec_Instance *e_exec_startup_desktop_instance_find(Efreet_Desktop *desktop);
37EAPI void e_exec_instance_found(E_Exec_Instance *inst);
38EAPI void e_exec_instance_watcher_add(E_Exec_Instance *inst, void (*func) (void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type), const void *data);
39EAPI void e_exec_instance_watcher_del(E_Exec_Instance *inst, void (*func) (void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type), const void *data);
29 40
30#endif 41#endif
31#endif 42#endif
diff --git a/src/modules/conf_applications/e_int_config_deskenv.c b/src/modules/conf_applications/e_int_config_deskenv.c
index ee18a5353..6a88a99fa 100644
--- a/src/modules/conf_applications/e_int_config_deskenv.c
+++ b/src/modules/conf_applications/e_int_config_deskenv.c
@@ -14,6 +14,7 @@ struct _E_Config_Dialog_Data
14 int load_xmodmap; 14 int load_xmodmap;
15 int load_gnome; 15 int load_gnome;
16 int load_kde; 16 int load_kde;
17 int exe_always_single_instance;
17}; 18};
18 19
19/* a nice easy setup function that does the dirty work */ 20/* a nice easy setup function that does the dirty work */
@@ -48,6 +49,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
48 cfdata->load_xmodmap = e_config->deskenv.load_xmodmap; 49 cfdata->load_xmodmap = e_config->deskenv.load_xmodmap;
49 cfdata->load_gnome = e_config->deskenv.load_gnome; 50 cfdata->load_gnome = e_config->deskenv.load_gnome;
50 cfdata->load_kde = e_config->deskenv.load_kde; 51 cfdata->load_kde = e_config->deskenv.load_kde;
52 cfdata->exe_always_single_instance = e_config->exe_always_single_instance;
51} 53}
52 54
53static void * 55static void *
@@ -74,6 +76,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
74 e_config->deskenv.load_xmodmap = cfdata->load_xmodmap; 76 e_config->deskenv.load_xmodmap = cfdata->load_xmodmap;
75 e_config->deskenv.load_gnome = cfdata->load_gnome; 77 e_config->deskenv.load_gnome = cfdata->load_gnome;
76 e_config->deskenv.load_kde = cfdata->load_kde; 78 e_config->deskenv.load_kde = cfdata->load_kde;
79 e_config->exe_always_single_instance = cfdata->exe_always_single_instance;
77 e_config_save_queue(); 80 e_config_save_queue();
78 return 1; /* Apply was OK */ 81 return 1; /* Apply was OK */
79} 82}
@@ -83,21 +86,34 @@ static Evas_Object *
83_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata) 86_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
84{ 87{
85 /* generate the core widget layout for a basic dialog */ 88 /* generate the core widget layout for a basic dialog */
86 Evas_Object *o, *ob; 89 Evas_Object *o, *fr, *ob;
87 90
88 o = e_widget_list_add(evas, 0, 0); 91 o = e_widget_list_add(evas, 0, 0);
92
93 fr = e_widget_framelist_add(evas, _("Execution"), 0);
94 ob = e_widget_check_add(evas, _("Only launch single instances"),
95 &(cfdata->exe_always_single_instance));
96 e_widget_framelist_object_append(fr, ob);
97 e_widget_list_object_append(o, fr, 1, 0, 0.0);
98
99 fr = e_widget_framelist_add(evas, _("X11 Basics"), 0);
89 ob = e_widget_check_add(evas, _("Load X Resources"), 100 ob = e_widget_check_add(evas, _("Load X Resources"),
90 &(cfdata->load_xrdb)); 101 &(cfdata->load_xrdb));
91 e_widget_list_object_append(o, ob, 1, 0, 0.0); 102 e_widget_framelist_object_append(fr, ob);
92 ob = e_widget_check_add(evas, _("Load X Modifier Map"), 103 ob = e_widget_check_add(evas, _("Load X Modifier Map"),
93 &(cfdata->load_xmodmap)); 104 &(cfdata->load_xmodmap));
94 e_widget_list_object_append(o, ob, 1, 0, 0.0); 105 e_widget_framelist_object_append(fr, ob);
106 e_widget_list_object_append(o, fr, 1, 0, 0.0);
107
108 fr = e_widget_framelist_add(evas, _("Major Desktops"), 0);
95 ob = e_widget_check_add(evas, _("Start GNOME services on login"), 109 ob = e_widget_check_add(evas, _("Start GNOME services on login"),
96 &(cfdata->load_gnome)); 110 &(cfdata->load_gnome));
97 e_widget_list_object_append(o, ob, 1, 0, 0.0); 111 e_widget_framelist_object_append(fr, ob);
98 ob = e_widget_check_add(evas, _("Start KDE services on login"), 112 ob = e_widget_check_add(evas, _("Start KDE services on login"),
99 &(cfdata->load_kde)); 113 &(cfdata->load_kde));
100 e_widget_list_object_append(o, ob, 1, 0, 0.0); 114 e_widget_framelist_object_append(fr, ob);
115 e_widget_list_object_append(o, fr, 1, 0, 0.0);
116
101 return o; 117 return o;
102} 118}
103 119
diff --git a/src/modules/ibar/e_mod_config.c b/src/modules/ibar/e_mod_config.c
index 2196c4b77..9d531162c 100644
--- a/src/modules/ibar/e_mod_config.c
+++ b/src/modules/ibar/e_mod_config.c
@@ -6,6 +6,7 @@ struct _E_Config_Dialog_Data
6 const char *dir; 6 const char *dir;
7 int show_label, eap_label; 7 int show_label, eap_label;
8 int lock_move; 8 int lock_move;
9 int track_launch;
9 10
10 Evas_Object *tlist; 11 Evas_Object *tlist;
11 Evas_Object *radio_name; 12 Evas_Object *radio_name;
@@ -66,6 +67,7 @@ _fill_data(Config_Item *ci, E_Config_Dialog_Data *cfdata)
66 cfdata->show_label = ci->show_label; 67 cfdata->show_label = ci->show_label;
67 cfdata->eap_label = ci->eap_label; 68 cfdata->eap_label = ci->eap_label;
68 cfdata->lock_move = ci->lock_move; 69 cfdata->lock_move = ci->lock_move;
70 cfdata->track_launch = !ci->dont_track_launch;
69} 71}
70 72
71static void * 73static void *
@@ -97,7 +99,7 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dial
97 99
98 o = e_widget_list_add(evas, 0, 0); 100 o = e_widget_list_add(evas, 0, 0);
99 101
100 of = e_widget_frametable_add(evas, _("Selected Bar Source"), 0); 102 of = e_widget_frametable_add(evas, _("Selected source"), 0);
101 ol = e_widget_ilist_add(evas, 32, 32, &(cfdata->dir)); 103 ol = e_widget_ilist_add(evas, 32, 32, &(cfdata->dir));
102 cfdata->tlist = ol; 104 cfdata->tlist = ol;
103 _load_tlist(cfdata); 105 _load_tlist(cfdata);
@@ -119,28 +121,30 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dial
119 e_widget_list_object_append(o, of, 1, 1, 0.5); 121 e_widget_list_object_append(o, of, 1, 1, 0.5);
120 122
121 of = e_widget_framelist_add(evas, _("Icon Labels"), 0); 123 of = e_widget_framelist_add(evas, _("Icon Labels"), 0);
122 ob = e_widget_check_add(evas, _("Show Icon Label"), &(cfdata->show_label)); 124 ob = e_widget_check_add(evas, _("Show icon label"), &(cfdata->show_label));
123 e_widget_on_change_hook_set(ob, _show_label_cb_change, cfdata); 125 e_widget_on_change_hook_set(ob, _show_label_cb_change, cfdata);
124 e_widget_framelist_object_append(of, ob); 126 e_widget_framelist_object_append(of, ob);
125 127
126 rg = e_widget_radio_group_new(&(cfdata->eap_label)); 128 rg = e_widget_radio_group_new(&(cfdata->eap_label));
127 129
128 cfdata->radio_name = e_widget_radio_add(evas, _("Display App Name"), 0, rg); 130 cfdata->radio_name = e_widget_radio_add(evas, _("Name"), 0, rg);
129 e_widget_framelist_object_append(of, cfdata->radio_name); 131 e_widget_framelist_object_append(of, cfdata->radio_name);
130 if (!cfdata->show_label) e_widget_disabled_set(cfdata->radio_name, 1); 132 if (!cfdata->show_label) e_widget_disabled_set(cfdata->radio_name, 1);
131 133
132 cfdata->radio_comment = e_widget_radio_add(evas, _("Display App Comment"), 1, rg); 134 cfdata->radio_comment = e_widget_radio_add(evas, _("Comment"), 1, rg);
133 e_widget_framelist_object_append(of, cfdata->radio_comment); 135 e_widget_framelist_object_append(of, cfdata->radio_comment);
134 if (!cfdata->show_label) e_widget_disabled_set(cfdata->radio_comment, 1); 136 if (!cfdata->show_label) e_widget_disabled_set(cfdata->radio_comment, 1);
135 137
136 cfdata->radio_generic = e_widget_radio_add(evas, _("Display App Generic"), 2, rg); 138 cfdata->radio_generic = e_widget_radio_add(evas, _("Generic"), 2, rg);
137 e_widget_framelist_object_append(of, cfdata->radio_generic); 139 e_widget_framelist_object_append(of, cfdata->radio_generic);
138 if (!cfdata->show_label) e_widget_disabled_set(cfdata->radio_generic, 1); 140 if (!cfdata->show_label) e_widget_disabled_set(cfdata->radio_generic, 1);
139 141
140 e_widget_list_object_append(o, of, 1, 1, 0.5); 142 e_widget_list_object_append(o, of, 1, 1, 0.5);
141 143
142 of = e_widget_framelist_add(evas, _("Icon Movement"), 0); 144 of = e_widget_framelist_add(evas, _("Misc"), 0);
143 ob = e_widget_check_add(evas, _("Lock Icon Move"), &(cfdata->lock_move)); 145 ob = e_widget_check_add(evas, _("Lock icon move"), &(cfdata->lock_move));
146 e_widget_framelist_object_append(of, ob);
147 ob = e_widget_check_add(evas, _("Track launch"), &(cfdata->track_launch));
144 e_widget_framelist_object_append(of, ob); 148 e_widget_framelist_object_append(of, ob);
145 149
146 e_widget_list_object_append(o, of, 1, 1, 0.5); 150 e_widget_list_object_append(o, of, 1, 1, 0.5);
@@ -160,6 +164,7 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
160 ci->show_label = cfdata->show_label; 164 ci->show_label = cfdata->show_label;
161 ci->eap_label = cfdata->eap_label; 165 ci->eap_label = cfdata->eap_label;
162 ci->lock_move = cfdata->lock_move; 166 ci->lock_move = cfdata->lock_move;
167 ci->dont_track_launch = !cfdata->track_launch;
163 _ibar_config_update(ci); 168 _ibar_config_update(ci);
164 e_config_save_queue(); 169 e_config_save_queue();
165 return 1; 170 return 1;
@@ -231,9 +236,13 @@ _cb_entry_ok(void *data, char *text)
231 int ret = 0; 236 int ret = 0;
232 237
233 /* Populate this .order file with some defaults */ 238 /* Populate this .order file with some defaults */
234 snprintf(tmp, sizeof(tmp), "xterm.desktop\n" "sylpheed.desktop\n" 239 snprintf(tmp, sizeof(tmp),
235 "firefox.desktop\n" "openoffice.desktop\n" "xchat.desktop\n" 240 "terminology.desktop\n"
236 "gimp.desktop\n" "xmms.desktop\n"); 241 "sylpheed.desktop\n"
242 "firefox.desktop\n"
243 "openoffice.desktop\n"
244 "xchat.desktop\n"
245 "gimp.desktop\n");
237 ret = fwrite(tmp, sizeof(char), strlen(tmp), f); 246 ret = fwrite(tmp, sizeof(char), strlen(tmp), f);
238 fclose(f); 247 fclose(f);
239 } 248 }
diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c
index 391ee4257..05dc9c695 100644
--- a/src/modules/ibar/e_mod_main.c
+++ b/src/modules/ibar/e_mod_main.c
@@ -66,12 +66,13 @@ struct _IBar
66 66
67struct _IBar_Icon 67struct _IBar_Icon
68{ 68{
69 IBar *ibar; 69 IBar *ibar;
70 Evas_Object *o_holder, *o_icon; 70 Evas_Object *o_holder, *o_icon;
71 Evas_Object *o_holder2, *o_icon2; 71 Evas_Object *o_holder2, *o_icon2;
72 Efreet_Desktop *app; 72 Efreet_Desktop *app;
73 Ecore_Timer *reset_timer; 73 Ecore_Timer *reset_timer;
74 int mouse_down; 74 E_Exec_Instance *exe_inst;
75 int mouse_down;
75 struct 76 struct
76 { 77 {
77 unsigned char start : 1; 78 unsigned char start : 1;
@@ -85,6 +86,7 @@ static IBar *_ibar_new(Evas *evas, Instance *inst);
85static void _ibar_free(IBar *b); 86static void _ibar_free(IBar *b);
86static void _ibar_cb_empty_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); 87static void _ibar_cb_empty_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
87static void _ibar_empty_handle(IBar *b); 88static void _ibar_empty_handle(IBar *b);
89static void _ibar_instance_watch(void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type);
88static void _ibar_fill(IBar *b); 90static void _ibar_fill(IBar *b);
89static void _ibar_empty(IBar *b); 91static void _ibar_empty(IBar *b);
90static void _ibar_orient_set(IBar *b, int horizontal); 92static void _ibar_orient_set(IBar *b, int horizontal);
@@ -515,7 +517,8 @@ _ibar_config_item_get(const char *id)
515 ci->dir = eina_stringshare_add("default"); 517 ci->dir = eina_stringshare_add("default");
516 ci->show_label = 1; 518 ci->show_label = 1;
517 ci->eap_label = 0; 519 ci->eap_label = 0;
518 ci->lock_move= 0; 520 ci->lock_move = 0;
521 ci->dont_track_launch = 0;
519 ibar_config->items = eina_list_append(ibar_config->items, ci); 522 ibar_config->items = eina_list_append(ibar_config->items, ci);
520 return ci; 523 return ci;
521} 524}
@@ -630,6 +633,11 @@ _ibar_icon_free(IBar_Icon *ic)
630 _ibar_icon_empty(ic); 633 _ibar_icon_empty(ic);
631 evas_object_del(ic->o_holder); 634 evas_object_del(ic->o_holder);
632 evas_object_del(ic->o_holder2); 635 evas_object_del(ic->o_holder2);
636 if (ic->exe_inst)
637 {
638 e_exec_instance_watcher_del(ic->exe_inst, _ibar_instance_watch, ic);
639 ic->exe_inst = NULL;
640 }
633 E_FREE(ic); 641 E_FREE(ic);
634} 642}
635 643
@@ -788,6 +796,7 @@ _ibar_cb_icon_mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED
788 ic = data; 796 ic = data;
789 if (ic->reset_timer) ecore_timer_del(ic->reset_timer); 797 if (ic->reset_timer) ecore_timer_del(ic->reset_timer);
790 ic->reset_timer = NULL; 798 ic->reset_timer = NULL;
799 if (ic->exe_inst) return;
791 ic->focused = EINA_TRUE; 800 ic->focused = EINA_TRUE;
792 _ibar_icon_signal_emit(ic, "e,state,focused", "e"); 801 _ibar_icon_signal_emit(ic, "e,state,focused", "e");
793 if (ic->ibar->inst->ci->show_label) 802 if (ic->ibar->inst->ci->show_label)
@@ -907,10 +916,50 @@ _ibar_cb_icon_reset(void *data)
907} 916}
908 917
909static void 918static void
919_ibar_instance_watch(void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type)
920{
921 IBar_Icon *ic = data;
922
923 switch (type)
924 {
925 case E_EXEC_WATCH_STARTED:
926 case E_EXEC_WATCH_STOPPED:
927 case E_EXEC_WATCH_TIMEOUT:
928 if (ic->exe_inst == inst)
929 {
930 _ibar_icon_signal_emit(ic, "e,state,started", "e");
931 e_exec_instance_watcher_del(inst, _ibar_instance_watch, ic);
932 ic->exe_inst = NULL;
933 }
934 break;
935 default:
936 break;
937 }
938}
939
940static void
910_ibar_icon_go(IBar_Icon *ic, Eina_Bool keep_going) 941_ibar_icon_go(IBar_Icon *ic, Eina_Bool keep_going)
911{ 942{
912 if (ic->app->type == EFREET_DESKTOP_TYPE_APPLICATION) 943 if (ic->app->type == EFREET_DESKTOP_TYPE_APPLICATION)
913 e_exec(ic->ibar->inst->gcc->gadcon->zone, ic->app, NULL, NULL, "ibar"); 944 {
945 if (ic->ibar->inst->ci->dont_track_launch)
946 e_exec(ic->ibar->inst->gcc->gadcon->zone,
947 ic->app, NULL, NULL, "ibar");
948 else
949 {
950 E_Exec_Instance *einst;
951
952 if (ic->exe_inst) return;
953 einst = e_exec(ic->ibar->inst->gcc->gadcon->zone,
954 ic->app, NULL, NULL, "ibar");
955 if (einst)
956 {
957 ic->exe_inst = einst;
958 e_exec_instance_watcher_add(einst, _ibar_instance_watch, ic);
959 _ibar_icon_signal_emit(ic, "e,state,starting", "e");
960 }
961 }
962 }
914 else if (ic->app->type == EFREET_DESKTOP_TYPE_LINK) 963 else if (ic->app->type == EFREET_DESKTOP_TYPE_LINK)
915 { 964 {
916 if (!strncasecmp(ic->app->url, "file:", 5)) 965 if (!strncasecmp(ic->app->url, "file:", 5))
@@ -921,14 +970,9 @@ _ibar_icon_go(IBar_Icon *ic, Eina_Bool keep_going)
921 if (act) act->func.go(NULL, ic->app->url + 5); 970 if (act) act->func.go(NULL, ic->app->url + 5);
922 } 971 }
923 } 972 }
924 /* TODO: bring back "e,action,start|stop" for the startup_notify apps
925 * when startup_notify is used again
926 */
927 _ibar_icon_signal_emit(ic, "e,action,exec", "e"); 973 _ibar_icon_signal_emit(ic, "e,action,exec", "e");
928 if (keep_going) 974 if (keep_going)
929 { 975 ic->reset_timer = ecore_timer_add(1.0, _ibar_cb_icon_reset, ic);
930 ic->reset_timer = ecore_timer_add(1.0, _ibar_cb_icon_reset, ic);
931 }
932} 976}
933 977
934static void 978static void
@@ -1713,6 +1757,7 @@ e_modapi_init(E_Module *m)
1713 E_CONFIG_VAL(D, T, show_label, INT); 1757 E_CONFIG_VAL(D, T, show_label, INT);
1714 E_CONFIG_VAL(D, T, eap_label, INT); 1758 E_CONFIG_VAL(D, T, eap_label, INT);
1715 E_CONFIG_VAL(D, T, lock_move, INT); 1759 E_CONFIG_VAL(D, T, lock_move, INT);
1760 E_CONFIG_VAL(D, T, dont_track_launch, UCHAR);
1716 1761
1717 conf_edd = E_CONFIG_DD_NEW("IBar_Config", Config); 1762 conf_edd = E_CONFIG_DD_NEW("IBar_Config", Config);
1718#undef T 1763#undef T
@@ -1734,7 +1779,8 @@ e_modapi_init(E_Module *m)
1734 ci->dir = eina_stringshare_add("default"); 1779 ci->dir = eina_stringshare_add("default");
1735 ci->show_label = 1; 1780 ci->show_label = 1;
1736 ci->eap_label = 0; 1781 ci->eap_label = 0;
1737 ci->lock_move= 0; 1782 ci->lock_move = 0;
1783 ci->dont_track_launch = 0;
1738 ibar_config->items = eina_list_append(ibar_config->items, ci); 1784 ibar_config->items = eina_list_append(ibar_config->items, ci);
1739 } 1785 }
1740 1786
diff --git a/src/modules/ibar/e_mod_main.h b/src/modules/ibar/e_mod_main.h
index b6bf3f664..47bdd7d48 100644
--- a/src/modules/ibar/e_mod_main.h
+++ b/src/modules/ibar/e_mod_main.h
@@ -22,6 +22,7 @@ struct _Config_Item
22 int show_label; 22 int show_label;
23 int eap_label; 23 int eap_label;
24 int lock_move; 24 int lock_move;
25 unsigned char dont_track_launch;
25}; 26};
26 27
27EAPI extern E_Module_Api e_modapi; 28EAPI extern E_Module_Api e_modapi;