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>
This commit is contained in:
Chris Michael 2015-01-06 13:01:31 -05:00
parent 32a7eecf50
commit e2a9988e5e
1 changed files with 27 additions and 4 deletions

View File

@ -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 send message to proxy");
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("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;
}