summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-01-06 13:01:31 -0500
committerChris Michael <cp.michael@samsung.com>2015-01-06 13:01:31 -0500
commite2a9988e5efcb606194a97f58e60815517e0c8a7 (patch)
tree6c2de51458515c97942d2520ac913b2f0bf2786b /src/lib/ecore_drm
parent32a7eecf504238dd1340272134c53ced9208d5bc (diff)
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>
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/ecore_drm_dbus.c31
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
120_ecore_drm_dbus_session_take(const char *session) 120_ecore_drm_dbus_session_take(const char *session)
121{ 121{
122 Eldbus_Proxy *proxy; 122 Eldbus_Proxy *proxy;
123 Eldbus_Message *msg, *reply;
124 const char *errname, *errmsg;
123 125
124 if ((session) && (strcmp(session, dsession))) 126 if ((session) && (strcmp(session, dsession)))
125 { 127 {
@@ -135,9 +137,18 @@ _ecore_drm_dbus_session_take(const char *session)
135 } 137 }
136 138
137 /* send call to take control */ 139 /* send call to take control */
138 if (eldbus_proxy_call(proxy, "TakeControl", NULL, NULL, -1, "b", EINA_FALSE)) 140 if (!(msg = eldbus_proxy_method_call_new(proxy, "TakeControl")))
141 {
142 ERR("Could not create method call for proxy");
143 return EINA_FALSE;
144 }
145
146 eldbus_message_arguments_append(msg, "b", EINA_FALSE);
147
148 reply = eldbus_proxy_send_and_block(proxy, msg, -1);
149 if (eldbus_message_error_get(reply, &errname, &errmsg))
139 { 150 {
140 ERR("Could not send message to proxy"); 151 ERR("Eldbus Message Error: %s %s", errname, errmsg);
141 return EINA_FALSE; 152 return EINA_FALSE;
142 } 153 }
143 154
@@ -148,6 +159,8 @@ static Eina_Bool
148_ecore_drm_dbus_session_release(const char *session) 159_ecore_drm_dbus_session_release(const char *session)
149{ 160{
150 Eldbus_Proxy *proxy; 161 Eldbus_Proxy *proxy;
162 Eldbus_Message *msg, *reply;
163 const char *errname, *errmsg;
151 164
152 if ((session) && (strcmp(session, dsession))) 165 if ((session) && (strcmp(session, dsession)))
153 { 166 {
@@ -163,8 +176,18 @@ _ecore_drm_dbus_session_release(const char *session)
163 } 176 }
164 177
165 /* send call to release control */ 178 /* send call to release control */
166 if (!eldbus_proxy_call(proxy, "ReleaseControl", NULL, NULL, -1, "")) 179 if (!(msg = eldbus_proxy_method_call_new(proxy, "ReleaseControl")))
167 ERR("Could not send ReleaseControl message to proxy"); 180 {
181 ERR("Could not create method call for proxy");
182 return EINA_FALSE;
183 }
184
185 reply = eldbus_proxy_send_and_block(proxy, msg, -1);
186 if (eldbus_message_error_get(reply, &errname, &errmsg))
187 {
188 ERR("Eldbus Message Error: %s %s", errname, errmsg);
189 return EINA_FALSE;
190 }
168 191
169 return EINA_TRUE; 192 return EINA_TRUE;
170} 193}