forked from enlightenment/enlightenment
add e_exec_phony to create fake e_exec instances on e restart
This commit is contained in:
parent
d8dc6df8c4
commit
12944d7afe
|
@ -1,6 +1,7 @@
|
|||
2013-05-18 Mike Blumenkrantz
|
||||
|
||||
* add e_exec_desktop_instances_find
|
||||
* add e_exec_phony
|
||||
|
||||
2013-05-14 Mike Blumenkrantz
|
||||
|
||||
|
|
1
NEWS
1
NEWS
|
@ -36,6 +36,7 @@ Additions:
|
|||
* added e_comp_win_effect* api
|
||||
* added deskmirror
|
||||
* add e_exec_desktop_instances_find
|
||||
* add e_exec_phony
|
||||
Config:
|
||||
* Added option for disabling icons in menus
|
||||
* Added option for disabling pointer warping when performing directional focus changes using winlist
|
||||
|
|
|
@ -4921,7 +4921,10 @@ _e_border_del(E_Border *bd)
|
|||
|
||||
if (bd->exe_inst)
|
||||
{
|
||||
bd->exe_inst->bd = NULL;
|
||||
if (bd->exe_inst->phony)
|
||||
e_exec_phony_del(bd->exe_inst);
|
||||
else
|
||||
bd->exe_inst->bd = NULL;
|
||||
bd->exe_inst = NULL;
|
||||
}
|
||||
|
||||
|
@ -7958,7 +7961,9 @@ _e_border_eval0(E_Border *bd)
|
|||
bd->client.netwm.pid = -1;
|
||||
}
|
||||
|
||||
if (!bd->re_manage)
|
||||
if (bd->re_manage)
|
||||
e_exec_phony(bd);
|
||||
else
|
||||
{
|
||||
inst = e_exec_startup_id_pid_instance_find(bd->client.netwm.startup_id,
|
||||
bd->client.netwm.pid);
|
||||
|
|
|
@ -200,6 +200,64 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec,
|
|||
return inst;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_exec_phony_del(E_Exec_Instance *inst)
|
||||
{
|
||||
if (!inst) return;
|
||||
EINA_SAFETY_ON_TRUE_RETURN(!inst->phony);
|
||||
_e_exec_instance_free(inst);
|
||||
}
|
||||
|
||||
EAPI E_Exec_Instance *
|
||||
e_exec_phony(E_Border *bd)
|
||||
{
|
||||
E_Exec_Instance *inst;
|
||||
Eina_List *l, *lnew;
|
||||
|
||||
inst = E_NEW(E_Exec_Instance, 1);
|
||||
inst->phony = 1;
|
||||
inst->desktop = bd->desktop;
|
||||
if (bd->desktop)
|
||||
{
|
||||
efreet_desktop_ref(bd->desktop);
|
||||
inst->key = eina_stringshare_add(bd->desktop->orig_path);
|
||||
}
|
||||
else if (bd->client.icccm.command.argc)
|
||||
{
|
||||
Eina_Strbuf *buf;
|
||||
int x;
|
||||
|
||||
buf = eina_strbuf_new();
|
||||
for (x = 0; x < bd->client.icccm.command.argc; x++)
|
||||
{
|
||||
eina_strbuf_append(buf, bd->client.icccm.command.argv[x]);
|
||||
if (x + 1 < bd->client.icccm.command.argc)
|
||||
eina_strbuf_append_char(buf, ' ');
|
||||
}
|
||||
inst->key = eina_stringshare_add(eina_strbuf_string_get(buf));
|
||||
eina_strbuf_free(buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
free(inst);
|
||||
return NULL;
|
||||
}
|
||||
inst->used = 1;
|
||||
bd->exe_inst = inst;
|
||||
inst->bd = bd;
|
||||
if (bd->zone) inst->screen = bd->zone->num;
|
||||
if (bd->desk)
|
||||
{
|
||||
inst->desk_x = bd->desk->x;
|
||||
inst->desk_y = bd->desk->y;
|
||||
}
|
||||
l = eina_hash_find(e_exec_instances, inst->key);
|
||||
lnew = eina_list_append(l, inst);
|
||||
if (l) eina_hash_modify(e_exec_instances, inst->key, lnew);
|
||||
else eina_hash_add(e_exec_instances, inst->key, lnew);
|
||||
return inst;
|
||||
}
|
||||
|
||||
EAPI E_Exec_Instance *
|
||||
e_exec_startup_id_pid_instance_find(int id, pid_t pid)
|
||||
{
|
||||
|
|
|
@ -20,6 +20,7 @@ struct _E_Exec_Instance
|
|||
int used;
|
||||
int walking;
|
||||
Eina_List *watchers;
|
||||
Eina_Bool phony : 1;
|
||||
};
|
||||
|
||||
typedef enum
|
||||
|
@ -33,6 +34,8 @@ EINTERN int e_exec_init(void);
|
|||
EINTERN int e_exec_shutdown(void);
|
||||
EAPI 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);
|
||||
EAPI E_Exec_Instance *e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, Eina_List *files, const char *launch_method);
|
||||
EAPI E_Exec_Instance *e_exec_phony(E_Border *bd);
|
||||
EAPI void e_exec_phony_del(E_Exec_Instance *inst);
|
||||
EAPI E_Exec_Instance *e_exec_startup_id_pid_instance_find(int id, pid_t pid);
|
||||
EAPI Efreet_Desktop *e_exec_startup_id_pid_find(int startup_id, pid_t pid);
|
||||
EAPI E_Exec_Instance *e_exec_startup_desktop_instance_find(Efreet_Desktop *desktop);
|
||||
|
|
Loading…
Reference in New Issue