{
E_Client *ec; //target E_Client
pid_t pid; //pid
+ const char *appid; //appid
E_Vis_Grab *vis_grab; //grab of target client's visibility
Eina_Bool delay_del; //refered delay_del
lc->serial = 0;
lc->target.pid = -1;
+ E_FREE_FUNC(lc->target.appid, eina_stringshare_del);
//if forward animation is failed, enlightenment can run animation instead.
if ((!success) && (target_ec))
lc->target.pid = -1;
lc->direction = 0;
+ E_FREE_FUNC(lc->target.appid, eina_stringshare_del);
E_FREE_FUNC(lc->buff_attach, ecore_event_handler_del);
if (target_ec)
lc->ec, app_id?:"NONE", instance_id?:"NONE", pid);
EINA_SAFETY_ON_TRUE_GOTO(lc->ec->visibility.obscured == E_VISIBILITY_FULLY_OBSCURED, send_stop);
- EINA_SAFETY_ON_TRUE_GOTO(pid < 0, send_stop);
+ EINA_SAFETY_ON_TRUE_GOTO((pid < 0) && !(app_id) , send_stop);
//check current state of lc
runner = _launcher_handler_launcher_runner_get();
_launcher_launched_ec_set(lc, NULL);
}
- lc->target.pid = pid;
lc->serial = serial;
- ecs = _launcher_clients_find_by_pid(pid);
- EINA_LIST_FOREACH(ecs, l, target_ec)
+ if (pid > 0 )
{
- if (e_object_is_del(E_OBJECT(target_ec))) continue;
- if (e_client_util_ignored_get(target_ec)) continue;
+ lc->target.pid = pid;
+ ecs = _launcher_clients_find_by_pid(pid);
+ EINA_LIST_FOREACH(ecs, l, target_ec)
+ {
+ if (e_object_is_del(E_OBJECT(target_ec))) continue;
+ if (e_client_util_ignored_get(target_ec)) continue;
- ELOGF("LAUNCHER_SRV", "Found target_ec:%p", lc->ec, target_ec);
+ ELOGF("LAUNCHER_SRV", "Found target_ec:%p", lc->ec, target_ec);
- sent = _launcher_prepare_forward_send(lc, target_ec);
- EINA_SAFETY_ON_FALSE_GOTO(sent, send_stop);
+ sent = _launcher_prepare_forward_send(lc, target_ec);
+ EINA_SAFETY_ON_FALSE_GOTO(sent, send_stop);
- _launcher_state_set(lc, LAUNCHER_STATE_PREPARING);
- break;
+ _launcher_state_set(lc, LAUNCHER_STATE_PREPARING);
+ break;
+ }
+ eina_list_free(ecs);
+ }
+
+ if (app_id)
+ {
+ lc->target.appid = eina_stringshare_add(app_id);
}
- eina_list_free(ecs);
if (!lc->target.ec)
{
lc->ec, app_id?:"NONE", instance_id?:"NONE", pid);
EINA_SAFETY_ON_TRUE_GOTO(lc->ec->visibility.obscured == E_VISIBILITY_FULLY_OBSCURED, send_stop);
- EINA_SAFETY_ON_TRUE_GOTO(pid < 0, send_stop);
+ EINA_SAFETY_ON_TRUE_GOTO((pid < 0) && !(app_id), send_stop);
// check current state of lc
runner = _launcher_handler_launcher_runner_get();
}
lc->with_swl = EINA_TRUE; /* set swl flag */
- lc->target.pid = pid;
lc->serial = serial;
- ecs = _launcher_clients_find_by_pid(pid);
- EINA_LIST_FOREACH(ecs, l, target_ec)
+ if (pid > 0)
{
- if (e_object_is_del(E_OBJECT(target_ec))) continue;
- if (e_client_util_ignored_get(target_ec)) continue;
+ lc->target.pid = pid;
+ ecs = _launcher_clients_find_by_pid(pid);
+ EINA_LIST_FOREACH(ecs, l, target_ec)
+ {
+ if (e_object_is_del(E_OBJECT(target_ec))) continue;
+ if (e_client_util_ignored_get(target_ec)) continue;
- ELOGF("LAUNCHER_SRV", "Found target_ec:%p", lc->ec, target_ec);
+ ELOGF("LAUNCHER_SRV", "Found target_ec:%p", lc->ec, target_ec);
- // send prepare_shared_widget event to callee
- sent = _launcher_prepare_shared_widget_forward_send(lc, target_ec);
- EINA_SAFETY_ON_FALSE_GOTO(sent, send_stop);
+ // send prepare_shared_widget event to callee
+ sent = _launcher_prepare_shared_widget_forward_send(lc, target_ec);
+ EINA_SAFETY_ON_FALSE_GOTO(sent, send_stop);
- _launcher_state_set(lc, LAUNCHER_STATE_WAIT_RESPONSE_FROM_CALLEE);
- break;
+ _launcher_state_set(lc, LAUNCHER_STATE_WAIT_RESPONSE_FROM_CALLEE);
+ break;
+ }
+ eina_list_free(ecs);
+ }
+
+ if (app_id)
+ {
+ lc->target.appid = eina_stringshare_add(app_id);
}
- eina_list_free(ecs);
if (!lc->target.ec)
{
_launcher_state_set(runner, LAUNCHER_STATE_CANCELED);
_launcher_stop_send(runner);
runner->target.pid = -1;
- runner->serial = 0;
+ runner->target.ec = NULL;
+ E_FREE_FUNC(runner->target.appid, eina_stringshare_del);
break;
default:
break;
else if (ec == runner->ec) goto show_allow; //show launcher
break;
case LAUNCHER_STATE_MONITORING: //waiting creation of target window
- if (ec->netwm.pid != runner->target.pid) goto show_allow;
+ if ((runner->target.pid > 0) &&
+ (ec->netwm.pid != runner->target.pid)) goto show_allow; //detect by pid
+ if ((runner->target.appid) && (runner->target.ec != ec)) goto show_allow; //detect by appid
if (e_object_is_del(E_OBJECT(ec))) goto show_allow;
if (runner->with_swl)
send_stop:
runner->target.pid = -1;
runner->serial = 0;
+ runner->target.ec = NULL;
+ E_FREE_FUNC(runner->target.appid, eina_stringshare_del);
+
_launcher_stop_send(runner);
_launcher_state_set(runner, LAUNCHER_STATE_IDLE);
_launcher_handler_launcher_runner_unset(runner);
}
}
}
+
+EINTERN void
+e_service_launcher_callee_register(const char *appid, E_Client *callee)
+{
+ E_Service_Launcher *runner;
+
+ EINA_SAFETY_ON_NULL_RETURN(callee);
+
+ runner = _launcher_handler_launcher_runner_get();
+ EINA_SAFETY_ON_NULL_RETURN(runner);
+ EINA_SAFETY_ON_TRUE_RETURN(runner->state != LAUNCHER_STATE_MONITORING);
+
+ if (runner->target.appid)
+ {
+ if (!e_util_strcmp(appid, runner->target.appid))
+ {
+ runner->target.ec = callee;
+
+ ELOGF("LAUNCHER_SRV", "Register callee(%p) by appid(%s)",
+ runner->ec, runner->target.ec, runner->target.appid);
+ }
+ }
+}