summaryrefslogtreecommitdiff
path: root/src/lib/elput/elput_logind.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-05-24 16:18:26 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-05-25 12:57:26 -0400
commit33a5d44dcf36557b13aeba1088461504bae97373 (patch)
tree540b218cbc6ed753be0e87573a8bb31489223875 /src/lib/elput/elput_logind.c
parent11393cfee3a014ed4ae9bfe267bc76a8a6cc5c20 (diff)
elput: remove 'sync' param from device management
unnecessarily complicates code
Diffstat (limited to 'src/lib/elput/elput_logind.c')
-rw-r--r--src/lib/elput/elput_logind.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c
index 394fca5465..3beb8b4eae 100644
--- a/src/lib/elput/elput_logind.c
+++ b/src/lib/elput/elput_logind.c
@@ -103,7 +103,7 @@ _cb_device_paused(void *data, const Eldbus_Message *msg)
103 if (!strcmp(type, "pause")) 103 if (!strcmp(type, "pause"))
104 _logind_device_pause_complete(em, maj, min); 104 _logind_device_pause_complete(em, maj, min);
105 105
106 if ((em->sync) && (maj == 226)) // DRM_MAJOR 106 if (maj == 226) // DRM_MAJOR
107 _logind_session_active_send(em, EINA_FALSE); 107 _logind_session_active_send(em, EINA_FALSE);
108 } 108 }
109} 109}
@@ -125,29 +125,11 @@ _cb_device_resumed(void *data, const Eldbus_Message *msg)
125 125
126 if (eldbus_message_arguments_get(msg, "u", &maj)) 126 if (eldbus_message_arguments_get(msg, "u", &maj))
127 { 127 {
128 if ((em->sync) && (maj == 226)) // DRM_MAJOR 128 if (maj == 226) // DRM_MAJOR
129 _logind_session_active_send(em, EINA_TRUE); 129 _logind_session_active_send(em, EINA_TRUE);
130 } 130 }
131} 131}
132 132
133static void
134_cb_property_changed(void *data, Eldbus_Proxy *proxy EINA_UNUSED, void *event)
135{
136 Elput_Manager *em;
137 Eldbus_Proxy_Event_Property_Changed *ev;
138 Eina_Bool active = EINA_FALSE;
139
140 em = data;
141 ev = event;
142
143 if (!strcmp(ev->name, "Active"))
144 {
145 eina_value_get(ev->value, &active);
146 if ((!em->sync) || (!active))
147 _logind_session_active_send(em, active);
148 }
149}
150
151static Eina_Bool 133static Eina_Bool
152_logind_session_vt_get(const char *sid, unsigned int *vt) 134_logind_session_vt_get(const char *sid, unsigned int *vt)
153{ 135{
@@ -239,9 +221,6 @@ _logind_dbus_setup(Elput_Manager *em)
239 goto proxy_err; 221 goto proxy_err;
240 } 222 }
241 223
242 eldbus_proxy_properties_monitor(proxy, EINA_TRUE);
243 eldbus_proxy_event_callback_add(proxy, ELDBUS_PROXY_EVENT_PROPERTY_CHANGED,
244 _cb_property_changed, em);
245 eldbus_proxy_unref(proxy); 224 eldbus_proxy_unref(proxy);
246 225
247 return EINA_TRUE; 226 return EINA_TRUE;
@@ -426,7 +405,7 @@ msg_err:
426} 405}
427 406
428static Eina_Bool 407static Eina_Bool
429_logind_connect(Elput_Manager **manager, const char *seat, unsigned int tty, Eina_Bool sync) 408_logind_connect(Elput_Manager **manager, const char *seat, unsigned int tty)
430{ 409{
431 Elput_Manager *em; 410 Elput_Manager *em;
432 int ret = 0; 411 int ret = 0;
@@ -436,7 +415,6 @@ _logind_connect(Elput_Manager **manager, const char *seat, unsigned int tty, Ein
436 if (!em) return EINA_FALSE; 415 if (!em) return EINA_FALSE;
437 416
438 em->interface = &_logind_interface; 417 em->interface = &_logind_interface;
439 em->sync = sync;
440 em->seat = eina_stringshare_add(seat); 418 em->seat = eina_stringshare_add(seat);
441 419
442 ret = sd_pid_get_session(getpid(), &em->sid); 420 ret = sd_pid_get_session(getpid(), &em->sid);