static void _e_processmgr_cb_hook_action_change(void *d EINA_UNUSED, E_Process *epro, void *user);
static Eldbus_Message* _e_processmgr_process_info_get(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg);
static Eldbus_Message *_e_processmgr_visible_window_info_get(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg);
+static Eldbus_Message *_e_processmgr_focus_pid_get(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg);
static Eina_Bool _e_processmgr_cb_client_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
static Eina_Bool _e_processmgr_cb_client_remove(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
static const Eldbus_Method _e_processmgr_methods[] = {
{ "GetProcStatus", ELDBUS_ARGS({"i", "pid"}), ELDBUS_ARGS({"i","process status"}, {"i", "focused"}), _e_processmgr_process_info_get, 0 },
{ "GetVisibleWinInfo", NULL, ELDBUS_ARGS({"a("VALUE_TYPE_FOR_VISIBLE_WINS")", "array of window"}), _e_processmgr_visible_window_info_get, 0 },
+ { "GetFocusProc", NULL, ELDBUS_ARGS({"i", "pid"}), _e_processmgr_focus_pid_get, 0 },
{ NULL, NULL, NULL, NULL, 0 }
};
return reply;
}
+static Eldbus_Message *
+_e_processmgr_focus_pid_get(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = NULL;
+ E_Client *ec;
+ int pid = -1;
+
+ reply = eldbus_message_method_return_new(msg);
+
+ ec = e_client_focused_get();
+ if (ec)
+ pid = _process_id_get(ec);
+
+ eldbus_message_arguments_append(reply, "i", pid);
+
+ return reply;
+}
+
static Eina_Bool
_e_processmgr_dbus_init(void *data EINA_UNUSED)
{