after years, finally fix an annoyance... application windows, IF e can

match them back to something IT started (ibar, menus, evrything
etc.)... it will keep those windows ON the zone/desktop u started them
on... hoobloodyray!



SVN revision: 70368
devs/princeamd/enlightenment-0.17-elive
Carsten Haitzler 11 years ago
parent c13f47db22
commit 81bb978614
  1. 53
      src/bin/e_border.c
  2. 25
      src/bin/e_exec.c
  3. 4
      src/bin/e_exec.h
  4. 31
      src/bin/e_hints.c

@ -7266,6 +7266,7 @@ _e_border_eval0(E_Border *bd)
if (bd->new_client)
{
E_Event_Border_Add *ev;
E_Exec_Instance *inst;
ev = E_NEW(E_Event_Border_Add, 1);
ev->border = bd;
@ -7275,6 +7276,56 @@ _e_border_eval0(E_Border *bd)
if ((!bd->lock_border) || (!bd->client.border.name))
bd->client.border.changed = 1;
{
char *str = NULL;
if ((ecore_x_netwm_startup_id_get(bd->client.win, &str) && (str)) ||
((bd->client.icccm.client_leader > 0) &&
ecore_x_netwm_startup_id_get(bd->client.icccm.client_leader, &str) && (str))
)
{
if (!strncmp(str, "E_START|", 8))
{
int id;
id = atoi(str + 8);
if (id > 0) bd->client.netwm.startup_id = id;
}
free(str);
}
}
/* It's ok not to have fetch flag, should only be set on startup
* * and not changed. */
if (!ecore_x_netwm_pid_get(bd->client.win, &bd->client.netwm.pid))
{
if (bd->client.icccm.client_leader)
{
if (!ecore_x_netwm_pid_get(bd->client.icccm.client_leader, &bd->client.netwm.pid))
bd->client.netwm.pid = -1;
}
else
bd->client.netwm.pid = -1;
}
inst = e_exec_startup_id_pid_instance_find(bd->client.netwm.startup_id,
bd->client.netwm.pid);
printf("MATCH %p [stid/pid = %i %i\n",
inst,
bd->client.netwm.startup_id,
bd->client.netwm.pid);
if (inst)
{
E_Zone *zone;
E_Desk *desk;
printf("match s/d: %i/%i,%i\n", inst->screen, inst->desk_x, inst->desk_y);
zone = e_container_zone_number_get(bd->zone->container,
inst->screen);
if (zone) e_border_zone_set(bd, zone);
desk = e_desk_at_xy_get(bd->zone, inst->desk_x, inst->desk_y);
if (desk) e_border_desk_set(bd, desk);
}
}
/* PRE_POST_FETCH calls e_remember apply for new client */
@ -8202,7 +8253,7 @@ _e_border_eval(E_Border *bd)
}
bd->changes.icon = 0;
}
bd->new_client = 0;
bd->changed = 0;
bd->changes.stack = 0;

@ -20,7 +20,7 @@ struct _E_Exec_Launch
struct _E_Exec_Search
{
Efreet_Desktop *desktop;
E_Exec_Instance *inst;
int startup_id;
pid_t pid;
};
@ -121,19 +121,32 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec,
}
else
inst = _e_exec_cb_exec(launch, NULL, strdup(exec), 0);
inst->screen = zone->num;
inst->desk_x = e_desk_current_get(zone)->x;
inst->desk_y = e_desk_current_get(zone)->y;
return inst;
}
EAPI Efreet_Desktop *
e_exec_startup_id_pid_find(int id, pid_t pid)
EAPI E_Exec_Instance *
e_exec_startup_id_pid_instance_find(int id, pid_t pid)
{
E_Exec_Search search;
search.desktop = NULL;
search.inst = NULL;
search.startup_id = id;
search.pid = pid;
eina_hash_foreach(e_exec_instances, _e_exec_startup_id_pid_find, &search);
return search.desktop;
return search.inst;
}
EAPI Efreet_Desktop *
e_exec_startup_id_pid_find(int id, pid_t pid)
{
E_Exec_Instance *inst;
inst = e_exec_startup_id_pid_instance_find(id, pid);
if (!inst) return NULL;
return inst->desktop;
}
/* local subsystem functions */
@ -451,7 +464,7 @@ _e_exec_startup_id_pid_find(const Eina_Hash *hash __UNUSED__, const void *key __
((inst->exe) && (search->pid > 1) &&
(search->pid == ecore_exe_pid_get(inst->exe))))
{
search->desktop = inst->desktop;
search->inst = inst;
return EINA_FALSE;
}
}

@ -14,13 +14,17 @@ struct _E_Exec_Instance
int startup_id;
double launch_time;
Ecore_Timer *expire_timer;
int screen;
int desk_x, desk_y;
};
EINTERN int e_exec_init(void);
EINTERN int e_exec_shutdown(void);
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_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);
#endif
#endif

@ -476,37 +476,6 @@ e_hints_window_init(E_Border *bd)
}
#endif
{
char *str = NULL;
if ((ecore_x_netwm_startup_id_get(bd->client.win, &str) && (str)) ||
((bd->client.icccm.client_leader > 0) &&
ecore_x_netwm_startup_id_get(bd->client.icccm.client_leader, &str) && (str))
)
{
if (!strncmp(str, "E_START|", 8))
{
int id;
id = atoi(str + 8);
if (id > 0) bd->client.netwm.startup_id = id;
}
free(str);
}
}
/* It's ok not to have fetch flag, should only be set on startup
* and not changed. */
if (!ecore_x_netwm_pid_get(bd->client.win, &bd->client.netwm.pid))
{
if (bd->client.icccm.client_leader)
{
if (!ecore_x_netwm_pid_get(bd->client.icccm.client_leader, &bd->client.netwm.pid))
bd->client.netwm.pid = -1;
}
else
bd->client.netwm.pid = -1;
}
if (bd->client.netwm.state.sticky)
{
if (!bd->lock_client_sticky)

Loading…
Cancel
Save