diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2016-05-24 16:14:41 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2016-05-24 16:45:30 -0400 |
commit | 6e3918fdb8c500a1840e9c2e46baf43deb42e528 (patch) | |
tree | 06fe6c900e3c4a856db5a8f913a19b6314f153a2 | |
parent | 80afd1aeac6abf9ec366627da6fddd1fa7d6f07d (diff) | |
download | efl-devs/discomfitor/elput.tar.gz |
elput: change some functions and internal flags to enable async input setupdevs/discomfitor/elput
this sets attributes on the Elput_Manager struct so that devices created at
a later point can then have relevant attributes applied to them
-rw-r--r-- | src/lib/elput/Elput.h | 35 | ||||
-rw-r--r-- | src/lib/elput/elput_evdev.c | 8 | ||||
-rw-r--r-- | src/lib/elput/elput_input.c | 10 | ||||
-rw-r--r-- | src/lib/elput/elput_logind.c | 10 | ||||
-rw-r--r-- | src/lib/elput/elput_manager.c | 17 | ||||
-rw-r--r-- | src/lib/elput/elput_private.h | 3 |
6 files changed, 39 insertions, 44 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h index 2f311608a4..77ba406e30 100644 --- a/src/lib/elput/Elput.h +++ b/src/lib/elput/Elput.h @@ -230,6 +230,24 @@ EAPI Eina_Bool elput_manager_vt_set(Elput_Manager *manager, int vt); */ EAPI const Eina_List *elput_manager_seats_get(Elput_Manager *manager); + +/** + * Set which window to use for this input manager + * + * @brief This function should be used to specify which window to set on the + * input manager. Setting a window on the input manager is done so that + * when we raise events (mouse movement, keyboard key, etc) then + * this window is passed to the event structure as the window which + * the event occured on. + * + * @param manager + * @param window + * + * @ingroup Elput_Manager_Group + * @since 1.18 + */ +EAPI void elput_manager_window_set(Elput_Manager *manager, unsigned int window); + /** * @defgroup Elput_Input_Group Elput input functions * @@ -329,23 +347,6 @@ EAPI void elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh */ /** - * Set which window to use for this input device - * - * @brief This function should be used to specify which window to set on the - * input device. Setting a window on the input device is done so that - * when we raise events (mouse movement, keyboard key, etc) then - * this window is passed to the event structure as the window which - * the event occured on. - * - * @param device - * @param window - * - * @ingroup Elput_Device_Group - * @since 1.18 - */ -EAPI void elput_device_window_set(Elput_Device *device, unsigned int window); - -/** * Set size of output for input device calibration * * @param device diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c index 45370197df..5095320ac8 100644 --- a/src/lib/elput/elput_evdev.c +++ b/src/lib/elput/elput_evdev.c @@ -1345,14 +1345,6 @@ _evdev_touch_get(Elput_Seat *seat) } EAPI void -elput_device_window_set(Elput_Device *device, unsigned int window) -{ - EINA_SAFETY_ON_NULL_RETURN(device); - - device->window = window; -} - -EAPI void elput_device_output_size_set(Elput_Device *device, int w, int h) { EINA_SAFETY_ON_NULL_RETURN(device); diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c index 8431c290b5..45778ebe91 100644 --- a/src/lib/elput/elput_input.c +++ b/src/lib/elput/elput_input.c @@ -500,12 +500,8 @@ elput_input_pointer_max_set(Elput_Manager *manager, int maxw, int maxh) Elput_Seat *eseat; EINA_SAFETY_ON_NULL_RETURN(manager); + manager->input.pointer_w = maxw; + manager->input.pointer_h = maxh; - EINA_LIST_FOREACH(manager->input.seats, l, eseat) - { - if (!eseat->ptr) continue; - - eseat->ptr->maxw = maxw; - eseat->ptr->maxh = maxh; - } + _elput_input_pointer_max_update(manager); } diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c index 8db4a113fa..475b1c68b0 100644 --- a/src/lib/elput/elput_logind.c +++ b/src/lib/elput/elput_logind.c @@ -200,16 +200,6 @@ _logind_dbus_setup(Elput_Manager *em) _cb_device_paused, em); eldbus_proxy_signal_handler_add(proxy, "ResumeDevice", _cb_device_resumed, em); - proxy = - eldbus_proxy_get(em->dbus.obj, "org.freedesktop.DBus.Properties"); - if (!proxy) - { - ERR("Could not get dbus proxy"); - goto proxy_err; - } - - eldbus_proxy_unref(proxy); - return EINA_TRUE; proxy_err: diff --git a/src/lib/elput/elput_manager.c b/src/lib/elput/elput_manager.c index 3b127afdc7..0dcc82055d 100644 --- a/src/lib/elput/elput_manager.c +++ b/src/lib/elput/elput_manager.c @@ -89,6 +89,7 @@ elput_manager_open(Elput_Manager *manager, const char *path, int flags) manager->vt_hdlr = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _cb_key_down, manager); + manager->vt_fd = ret; } } @@ -101,8 +102,11 @@ elput_manager_close(Elput_Manager *manager, int fd) EINA_SAFETY_ON_NULL_RETURN(manager); EINA_SAFETY_ON_NULL_RETURN(manager->interface); - if (manager->vt_hdlr) ecore_event_handler_del(manager->vt_hdlr); - manager->vt_hdlr = NULL; + if (fd == manager->vt_fd) + { + if (manager->vt_hdlr) ecore_event_handler_del(manager->vt_hdlr); + manager->vt_hdlr = NULL; + } if (manager->interface->close) manager->interface->close(manager, fd); @@ -121,6 +125,15 @@ elput_manager_vt_set(Elput_Manager *manager, int vt) return EINA_FALSE; } +EAPI void +elput_manager_window_set(Elput_Manager *manager, unsigned int window) +{ + EINA_SAFETY_ON_NULL_RETURN(manager); + + manager->window = window; + _elput_input_window_update(manager); +} + EAPI const Eina_List * elput_manager_seats_get(Elput_Manager *manager) { diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h index a934bf1d23..0fc5d6af32 100644 --- a/src/lib/elput/elput_private.h +++ b/src/lib/elput/elput_private.h @@ -86,6 +86,7 @@ typedef struct _Elput_Input Ecore_Thread *thread; Eldbus_Pending *current_pending; int pipe; + int pointer_w, pointer_h; Eina_Bool suspended : 1; } Elput_Input; @@ -252,6 +253,8 @@ typedef struct _Elput_Async_Open int flags; } Elput_Async_Open; +void _elput_input_window_update(Elput_Manager *manager); + int _evdev_event_process(struct libinput_event *event); Elput_Device *_evdev_device_create(Elput_Seat *seat, struct libinput_device *device); void _evdev_device_destroy(Elput_Device *edev); |