summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--NEWS1
-rw-r--r--src/bin/e_border.c9
-rw-r--r--src/bin/e_exec.c58
-rw-r--r--src/bin/e_exec.h3
5 files changed, 70 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f6e395ab8..36d7d106f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
12013-05-18 Mike Blumenkrantz 12013-05-18 Mike Blumenkrantz
2 2
3 * add e_exec_desktop_instances_find 3 * add e_exec_desktop_instances_find
4 * add e_exec_phony
4 5
52013-05-14 Mike Blumenkrantz 62013-05-14 Mike Blumenkrantz
6 7
diff --git a/NEWS b/NEWS
index c326ce6f5..9c5753019 100644
--- a/NEWS
+++ b/NEWS
@@ -36,6 +36,7 @@ Additions:
36 * added e_comp_win_effect* api 36 * added e_comp_win_effect* api
37 * added deskmirror 37 * added deskmirror
38 * add e_exec_desktop_instances_find 38 * add e_exec_desktop_instances_find
39 * add e_exec_phony
39 Config: 40 Config:
40 * Added option for disabling icons in menus 41 * Added option for disabling icons in menus
41 * Added option for disabling pointer warping when performing directional focus changes using winlist 42 * Added option for disabling pointer warping when performing directional focus changes using winlist
diff --git a/src/bin/e_border.c b/src/bin/e_border.c
index 91a0133cb..4bbebcf54 100644
--- a/src/bin/e_border.c
+++ b/src/bin/e_border.c
@@ -4921,7 +4921,10 @@ _e_border_del(E_Border *bd)
4921 4921
4922 if (bd->exe_inst) 4922 if (bd->exe_inst)
4923 { 4923 {
4924 bd->exe_inst->bd = NULL; 4924 if (bd->exe_inst->phony)
4925 e_exec_phony_del(bd->exe_inst);
4926 else
4927 bd->exe_inst->bd = NULL;
4925 bd->exe_inst = NULL; 4928 bd->exe_inst = NULL;
4926 } 4929 }
4927 4930
@@ -7958,7 +7961,9 @@ _e_border_eval0(E_Border *bd)
7958 bd->client.netwm.pid = -1; 7961 bd->client.netwm.pid = -1;
7959 } 7962 }
7960 7963
7961 if (!bd->re_manage) 7964 if (bd->re_manage)
7965 e_exec_phony(bd);
7966 else
7962 { 7967 {
7963 inst = e_exec_startup_id_pid_instance_find(bd->client.netwm.startup_id, 7968 inst = e_exec_startup_id_pid_instance_find(bd->client.netwm.startup_id,
7964 bd->client.netwm.pid); 7969 bd->client.netwm.pid);
diff --git a/src/bin/e_exec.c b/src/bin/e_exec.c
index 91ae02399..75fec649d 100644
--- a/src/bin/e_exec.c
+++ b/src/bin/e_exec.c
@@ -200,6 +200,64 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec,
200 return inst; 200 return inst;
201} 201}
202 202
203EAPI void
204e_exec_phony_del(E_Exec_Instance *inst)
205{
206 if (!inst) return;
207 EINA_SAFETY_ON_TRUE_RETURN(!inst->phony);
208 _e_exec_instance_free(inst);
209}
210
211EAPI E_Exec_Instance *
212e_exec_phony(E_Border *bd)
213{
214 E_Exec_Instance *inst;
215 Eina_List *l, *lnew;
216
217 inst = E_NEW(E_Exec_Instance, 1);
218 inst->phony = 1;
219 inst->desktop = bd->desktop;
220 if (bd->desktop)
221 {
222 efreet_desktop_ref(bd->desktop);
223 inst->key = eina_stringshare_add(bd->desktop->orig_path);
224 }
225 else if (bd->client.icccm.command.argc)
226 {
227 Eina_Strbuf *buf;
228 int x;
229
230 buf = eina_strbuf_new();
231 for (x = 0; x < bd->client.icccm.command.argc; x++)
232 {
233 eina_strbuf_append(buf, bd->client.icccm.command.argv[x]);
234 if (x + 1 < bd->client.icccm.command.argc)
235 eina_strbuf_append_char(buf, ' ');
236 }
237 inst->key = eina_stringshare_add(eina_strbuf_string_get(buf));
238 eina_strbuf_free(buf);
239 }
240 else
241 {
242 free(inst);
243 return NULL;
244 }
245 inst->used = 1;
246 bd->exe_inst = inst;
247 inst->bd = bd;
248 if (bd->zone) inst->screen = bd->zone->num;
249 if (bd->desk)
250 {
251 inst->desk_x = bd->desk->x;
252 inst->desk_y = bd->desk->y;
253 }
254 l = eina_hash_find(e_exec_instances, inst->key);
255 lnew = eina_list_append(l, inst);
256 if (l) eina_hash_modify(e_exec_instances, inst->key, lnew);
257 else eina_hash_add(e_exec_instances, inst->key, lnew);
258 return inst;
259}
260
203EAPI E_Exec_Instance * 261EAPI E_Exec_Instance *
204e_exec_startup_id_pid_instance_find(int id, pid_t pid) 262e_exec_startup_id_pid_instance_find(int id, pid_t pid)
205{ 263{
diff --git a/src/bin/e_exec.h b/src/bin/e_exec.h
index 31e195240..89e182611 100644
--- a/src/bin/e_exec.h
+++ b/src/bin/e_exec.h
@@ -20,6 +20,7 @@ struct _E_Exec_Instance
20 int used; 20 int used;
21 int walking; 21 int walking;
22 Eina_List *watchers; 22 Eina_List *watchers;
23 Eina_Bool phony : 1;
23}; 24};
24 25
25typedef enum 26typedef enum
@@ -33,6 +34,8 @@ EINTERN int e_exec_init(void);
33EINTERN int e_exec_shutdown(void); 34EINTERN int e_exec_shutdown(void);
34EAPI void e_exec_executor_set(E_Exec_Instance *(*func) (void *data, E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method), const void *data); 35EAPI void e_exec_executor_set(E_Exec_Instance *(*func) (void *data, E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method), const void *data);
35EAPI E_Exec_Instance *e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method); 36EAPI E_Exec_Instance *e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method);
37EAPI E_Exec_Instance *e_exec_phony(E_Border *bd);
38EAPI void e_exec_phony_del(E_Exec_Instance *inst);
36EAPI E_Exec_Instance *e_exec_startup_id_pid_instance_find(int id, pid_t pid); 39EAPI E_Exec_Instance *e_exec_startup_id_pid_instance_find(int id, pid_t pid);
37EAPI Efreet_Desktop *e_exec_startup_id_pid_find(int startup_id, pid_t pid); 40EAPI Efreet_Desktop *e_exec_startup_id_pid_find(int startup_id, pid_t pid);
38EAPI E_Exec_Instance *e_exec_startup_desktop_instance_find(Efreet_Desktop *desktop); 41EAPI E_Exec_Instance *e_exec_startup_desktop_instance_find(Efreet_Desktop *desktop);