diff options
author | Chris Michael <cp.michael@samsung.com> | 2015-01-06 13:01:31 -0500 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2015-01-06 13:01:31 -0500 |
commit | e2a9988e5efcb606194a97f58e60815517e0c8a7 (patch) | |
tree | 6c2de51458515c97942d2520ac913b2f0bf2786b | |
parent | 32a7eecf504238dd1340272134c53ced9208d5bc (diff) | |
download | efl-e2a9988e5efcb606194a97f58e60815517e0c8a7.tar.gz |
ecore-drm: Fix issue with TakeControl and ReleaseControl functions
Summary: The dbus calls to TakeControl and ReleaseControl of a session
are actual Methods that need to be setup and called in order to
operate properly. As such, this commit fixes that issue by using the
proper eldbus method calls, and fixes an issue where shutting down
Enlightenment would lead to "cannot release control" error messages.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r-- | src/lib/ecore_drm/ecore_drm_dbus.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_dbus.c b/src/lib/ecore_drm/ecore_drm_dbus.c index 5106cf97c6..292879eee1 100644 --- a/src/lib/ecore_drm/ecore_drm_dbus.c +++ b/src/lib/ecore_drm/ecore_drm_dbus.c @@ -120,6 +120,8 @@ static Eina_Bool _ecore_drm_dbus_session_take(const char *session) { Eldbus_Proxy *proxy; + Eldbus_Message *msg, *reply; + const char *errname, *errmsg; if ((session) && (strcmp(session, dsession))) { @@ -135,9 +137,18 @@ _ecore_drm_dbus_session_take(const char *session) } /* send call to take control */ - if (eldbus_proxy_call(proxy, "TakeControl", NULL, NULL, -1, "b", EINA_FALSE)) + if (!(msg = eldbus_proxy_method_call_new(proxy, "TakeControl"))) + { + ERR("Could not create method call for proxy"); + return EINA_FALSE; + } + + eldbus_message_arguments_append(msg, "b", EINA_FALSE); + + reply = eldbus_proxy_send_and_block(proxy, msg, -1); + if (eldbus_message_error_get(reply, &errname, &errmsg)) { - ERR("Could not send message to proxy"); + ERR("Eldbus Message Error: %s %s", errname, errmsg); return EINA_FALSE; } @@ -148,6 +159,8 @@ static Eina_Bool _ecore_drm_dbus_session_release(const char *session) { Eldbus_Proxy *proxy; + Eldbus_Message *msg, *reply; + const char *errname, *errmsg; if ((session) && (strcmp(session, dsession))) { @@ -163,8 +176,18 @@ _ecore_drm_dbus_session_release(const char *session) } /* send call to release control */ - if (!eldbus_proxy_call(proxy, "ReleaseControl", NULL, NULL, -1, "")) - ERR("Could not send ReleaseControl message to proxy"); + if (!(msg = eldbus_proxy_method_call_new(proxy, "ReleaseControl"))) + { + ERR("Could not create method call for proxy"); + return EINA_FALSE; + } + + reply = eldbus_proxy_send_and_block(proxy, msg, -1); + if (eldbus_message_error_get(reply, &errname, &errmsg)) + { + ERR("Eldbus Message Error: %s %s", errname, errmsg); + return EINA_FALSE; + } return EINA_TRUE; } |