diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2016-05-24 16:18:26 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2016-05-25 12:57:26 -0400 |
commit | 33a5d44dcf36557b13aeba1088461504bae97373 (patch) | |
tree | 540b218cbc6ed753be0e87573a8bb31489223875 /src/lib/elput | |
parent | 11393cfee3a014ed4ae9bfe267bc76a8a6cc5c20 (diff) |
elput: remove 'sync' param from device management
unnecessarily complicates code
Diffstat (limited to 'src/lib/elput')
-rw-r--r-- | src/lib/elput/Elput.h | 2 | ||||
-rw-r--r-- | src/lib/elput/elput_logind.c | 28 | ||||
-rw-r--r-- | src/lib/elput/elput_manager.c | 4 | ||||
-rw-r--r-- | src/lib/elput/elput_private.h | 4 |
4 files changed, 7 insertions, 31 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h index 6a4545d8cd..07ebfa2f97 100644 --- a/src/lib/elput/Elput.h +++ b/src/lib/elput/Elput.h | |||
@@ -168,7 +168,7 @@ EAPI int elput_shutdown(void); | |||
168 | * @ingroup Elput_Manager_Group | 168 | * @ingroup Elput_Manager_Group |
169 | * @since 1.18 | 169 | * @since 1.18 |
170 | */ | 170 | */ |
171 | EAPI Elput_Manager *elput_manager_connect(const char *seat, unsigned int tty, Eina_Bool sync); | 171 | EAPI Elput_Manager *elput_manager_connect(const char *seat, unsigned int tty); |
172 | 172 | ||
173 | /** | 173 | /** |
174 | * Disconnect an input manager | 174 | * Disconnect an input manager |
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 | ||
133 | static 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 | |||
151 | static Eina_Bool | 133 | static 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 | ||
428 | static Eina_Bool | 407 | static 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); |
diff --git a/src/lib/elput/elput_manager.c b/src/lib/elput/elput_manager.c index 9145e9c434..b1378f55b0 100644 --- a/src/lib/elput/elput_manager.c +++ b/src/lib/elput/elput_manager.c | |||
@@ -35,7 +35,7 @@ _cb_key_down(void *data, int type EINA_UNUSED, void *event) | |||
35 | } | 35 | } |
36 | 36 | ||
37 | EAPI Elput_Manager * | 37 | EAPI Elput_Manager * |
38 | elput_manager_connect(const char *seat, unsigned int tty, Eina_Bool sync) | 38 | elput_manager_connect(const char *seat, unsigned int tty) |
39 | { | 39 | { |
40 | Elput_Interface **it; | 40 | Elput_Interface **it; |
41 | 41 | ||
@@ -45,7 +45,7 @@ elput_manager_connect(const char *seat, unsigned int tty, Eina_Bool sync) | |||
45 | Elput_Manager *em; | 45 | Elput_Manager *em; |
46 | 46 | ||
47 | iface = *it; | 47 | iface = *it; |
48 | if (iface->connect(&em, seat, tty, sync)) | 48 | if (iface->connect(&em, seat, tty)) |
49 | return em; | 49 | return em; |
50 | } | 50 | } |
51 | 51 | ||
diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h index 1f6d6084d8..c2f4b007ea 100644 --- a/src/lib/elput/elput_private.h +++ b/src/lib/elput/elput_private.h | |||
@@ -68,7 +68,7 @@ typedef enum _Elput_Device_Capability | |||
68 | 68 | ||
69 | typedef struct _Elput_Interface | 69 | typedef struct _Elput_Interface |
70 | { | 70 | { |
71 | Eina_Bool (*connect)(Elput_Manager **manager, const char *seat, unsigned int tty, Eina_Bool sync); | 71 | Eina_Bool (*connect)(Elput_Manager **manager, const char *seat, unsigned int tty); |
72 | void (*disconnect)(Elput_Manager *manager); | 72 | void (*disconnect)(Elput_Manager *manager); |
73 | int (*open)(Elput_Manager *manager, const char *path, int flags); | 73 | int (*open)(Elput_Manager *manager, const char *path, int flags); |
74 | void (*close)(Elput_Manager *manager, int fd); | 74 | void (*close)(Elput_Manager *manager, int fd); |
@@ -234,8 +234,6 @@ struct _Elput_Manager | |||
234 | } dbus; | 234 | } dbus; |
235 | 235 | ||
236 | Elput_Input input; | 236 | Elput_Input input; |
237 | |||
238 | Eina_Bool sync : 1; | ||
239 | }; | 237 | }; |
240 | 238 | ||
241 | int _evdev_event_process(struct libinput_event *event); | 239 | int _evdev_event_process(struct libinput_event *event); |