From: Sung-Jin Park Date: Sat, 24 Jul 2021 18:19:03 +0000 (+0900) Subject: mmi-client: added apis for setting/getting has_focus of a client X-Git-Tag: submit/tizen/20210914.041950~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=abfcbf197c5ebd2f34ec346bc53691c7ee54724c;p=platform%2Fcore%2Fuifw%2Fmmi-manager.git mmi-client: added apis for setting/getting has_focus of a client Change-Id: I47647e8e1309853a98a4761670124f2daa41b568 Signed-off-by: Sung-Jin Park --- diff --git a/src/mmi-client.c b/src/mmi-client.c index 043f68b..eb6904c 100644 --- a/src/mmi-client.c +++ b/src/mmi-client.c @@ -35,6 +35,7 @@ struct _mmi_client uid_t uid; pid_t pid; mmi_state state; + bool has_focus; rpc_port_focus_event_h focus_cb_h; rpc_port_state_change_event_h state_change_cb_h; @@ -127,7 +128,6 @@ client_manager_remove_client(const char *sender) goto err; } - if (!eina_hash_del(_client_hash, sender, mc)) { LOGE("Failed to remove client info using sender(=%s) !\n", sender); @@ -206,6 +206,25 @@ client_manager_get_client_state(mmi_client *client) return client->state; } +bool +client_manager_set_client_has_focus(mmi_client *client, bool has_focus) +{ + if (!client) + return false; + + client->has_focus = has_focus; + return client->has_focus; +} + +bool +client_manager_get_client_has_focus(mmi_client *client) +{ + if (!client) + return false; + + return client->has_focus; +} + static void _cleanup_client_hash(void) { diff --git a/src/mmi-client.h b/src/mmi-client.h index feb07aa..618c896 100644 --- a/src/mmi-client.h +++ b/src/mmi-client.h @@ -42,6 +42,8 @@ int client_manager_set_client_pid(mmi_client *client, pid_t pid); int client_manager_get_client_pid(mmi_client *client); mmi_state client_manager_set_client_state(mmi_client *client, mmi_state state); mmi_state client_manager_get_client_state(mmi_client *client); +bool client_manager_set_client_has_focus(mmi_client *client, bool has_focus); +bool client_manager_get_client_has_focus(mmi_client *client); void *client_manager_set_client_focus_cb_handle(mmi_client *client, void *focus_cb_h); void *client_manager_get_client_focus_cb_handle(mmi_client *client);