summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-05-26 16:34:10 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-05-26 16:27:43 -0400
commited4e54ebe2da6b0c2f04bc118286b1b3251edbd9 (patch)
tree3925e41202b2a3efdaaa1dda976a7a964d522db9 /src/lib
parent6775b23212305c957f4447c708053585f361bb86 (diff)
wayland/drm: create evas_devices and add device pointer to input events
this is still semi-broken if a seat has many pointer-ish type devices since pointer devices in ecore-evas were never correctly implemented to be 1:1 with seat:cursor relationships @feature
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_private.h3
-rw-r--r--src/lib/elput/elput_evdev.c6
-rw-r--r--src/lib/elput/elput_private.h4
-rw-r--r--src/lib/evas/canvas/evas_main.c6
4 files changed, 15 insertions, 4 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h
index 2be6069b69..a7e3766d59 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -20,6 +20,7 @@
20# include <sys/ioctl.h> 20# include <sys/ioctl.h>
21# include <dlfcn.h> 21# include <dlfcn.h>
22 22
23#ifndef DRM2_NODEFS
23extern int _ecore_drm2_log_dom; 24extern int _ecore_drm2_log_dom;
24extern Eina_Bool _ecore_drm2_use_atomic; 25extern Eina_Bool _ecore_drm2_use_atomic;
25 26
@@ -52,7 +53,7 @@ extern Eina_Bool _ecore_drm2_use_atomic;
52# undef CRIT 53# undef CRIT
53# endif 54# endif
54# define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_drm2_log_dom, __VA_ARGS__) 55# define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_drm2_log_dom, __VA_ARGS__)
55 56#endif
56/* The following defines and structures were borrowed from drm.h */ 57/* The following defines and structures were borrowed from drm.h */
57 58
58/** 59/**
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index a212691787..741d1fdfb2 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -300,6 +300,7 @@ _keyboard_key_send(Elput_Device *dev, enum libinput_key_state state, const char
300 ev->modifiers = dev->seat->modifiers; 300 ev->modifiers = dev->seat->modifiers;
301 ev->timestamp = timestamp; 301 ev->timestamp = timestamp;
302 ev->same_screen = 1; 302 ev->same_screen = 1;
303 ev->dev = dev->evas_device;
303 304
304 ev->window = dev->seat->manager->window; 305 ev->window = dev->seat->manager->window;
305 ev->event_window = dev->seat->manager->window; 306 ev->event_window = dev->seat->manager->window;
@@ -803,6 +804,7 @@ _pointer_motion_send(Elput_Device *edev)
803 ev->root_window = edev->seat->manager->window; 804 ev->root_window = edev->seat->manager->window;
804 ev->timestamp = ptr->timestamp; 805 ev->timestamp = ptr->timestamp;
805 ev->same_screen = 1; 806 ev->same_screen = 1;
807 ev->dev = edev->evas_device;
806 808
807 ev->x = ptr->x; 809 ev->x = ptr->x;
808 ev->y = ptr->y; 810 ev->y = ptr->y;
@@ -912,6 +914,7 @@ _pointer_button_send(Elput_Device *edev, enum libinput_button_state state)
912 ev->root_window = edev->seat->manager->window; 914 ev->root_window = edev->seat->manager->window;
913 ev->timestamp = ptr->timestamp; 915 ev->timestamp = ptr->timestamp;
914 ev->same_screen = 1; 916 ev->same_screen = 1;
917 ev->dev = edev->evas_device;
915 918
916 ev->x = ptr->x; 919 ev->x = ptr->x;
917 ev->y = ptr->y; 920 ev->y = ptr->y;
@@ -1033,6 +1036,7 @@ _pointer_axis_send(Elput_Device *dev, int direction, int value)
1033 ev->root_window = dev->seat->manager->window; 1036 ev->root_window = dev->seat->manager->window;
1034 ev->timestamp = ptr->timestamp; 1037 ev->timestamp = ptr->timestamp;
1035 ev->same_screen = 1; 1038 ev->same_screen = 1;
1039 ev->dev = dev->evas_device;
1036 1040
1037 ev->x = ptr->x; 1041 ev->x = ptr->x;
1038 ev->y = ptr->y; 1042 ev->y = ptr->y;
@@ -1189,6 +1193,7 @@ _touch_motion_send(Elput_Device *dev)
1189 ev->root_window = dev->seat->manager->window; 1193 ev->root_window = dev->seat->manager->window;
1190 ev->timestamp = touch->timestamp; 1194 ev->timestamp = touch->timestamp;
1191 ev->same_screen = 1; 1195 ev->same_screen = 1;
1196 ev->dev = dev->evas_device;
1192 1197
1193 ev->x = lround(touch->x); 1198 ev->x = lround(touch->x);
1194 ev->y = lround(touch->y); 1199 ev->y = lround(touch->y);
@@ -1447,6 +1452,7 @@ _tablet_tool_axis(struct libinput_device *idev, struct libinput_event_tablet_too
1447 ev->root_window = dev->seat->manager->window; 1452 ev->root_window = dev->seat->manager->window;
1448 ev->timestamp = ptr->timestamp; 1453 ev->timestamp = ptr->timestamp;
1449 ev->naxis = num; 1454 ev->naxis = num;
1455 ev->dev = dev->evas_device;
1450 ev->axis = axis = calloc(num, sizeof(Ecore_Axis)); 1456 ev->axis = axis = calloc(num, sizeof(Ecore_Axis));
1451 for (i = 0; i < num; i++) 1457 for (i = 0; i < num; i++)
1452 { 1458 {
diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h
index 982d3f58c0..202c52bbef 100644
--- a/src/lib/elput/elput_private.h
+++ b/src/lib/elput/elput_private.h
@@ -28,6 +28,7 @@
28# include <systemd/sd-login.h> 28# include <systemd/sd-login.h>
29# endif 29# endif
30 30
31#ifndef ELPUT_NODEFS
31# ifdef ELPUT_DEFAULT_LOG_COLOR 32# ifdef ELPUT_DEFAULT_LOG_COLOR
32# undef ELPUT_DEFAULT_LOG_COLOR 33# undef ELPUT_DEFAULT_LOG_COLOR
33# endif 34# endif
@@ -59,7 +60,7 @@ extern int _elput_log_dom;
59# undef CRIT 60# undef CRIT
60# endif 61# endif
61# define CRIT(...) EINA_LOG_DOM_CRIT(_elput_log_dom, __VA_ARGS__) 62# define CRIT(...) EINA_LOG_DOM_CRIT(_elput_log_dom, __VA_ARGS__)
62 63#endif
63typedef struct _Elput_Interface 64typedef struct _Elput_Interface
64{ 65{
65 Eina_Bool (*connect)(Elput_Manager **manager, const char *seat, unsigned int tty); 66 Eina_Bool (*connect)(Elput_Manager **manager, const char *seat, unsigned int tty);
@@ -218,6 +219,7 @@ struct _Elput_Device
218 Elput_Device_Caps caps; 219 Elput_Device_Caps caps;
219 220
220 Eina_Hash *key_remap_hash; 221 Eina_Hash *key_remap_hash;
222 Eo *evas_device;
221 223
222 Eina_Bool left_handed : 1; 224 Eina_Bool left_handed : 1;
223 Eina_Bool key_remap : 1; 225 Eina_Bool key_remap : 1;
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index e03af07986..0229e0d3b2 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -1006,9 +1006,11 @@ evas_output_method_set(Evas *eo_e, int render_method)
1006 output->info = e->engine.func->info(eo_e); 1006 output->info = e->engine.func->info(eo_e);
1007 } 1007 }
1008 1008
1009 // Wayland already handles seats. 1009 // Wayland/drm already handles seats.
1010 if (em->definition && (eina_streq(em->definition->name, "wayland_shm") || 1010 if (em->definition && (eina_streq(em->definition->name, "wayland_shm") ||
1011 eina_streq(em->definition->name, "wayland_egl"))) 1011 eina_streq(em->definition->name, "wayland_egl") ||
1012 eina_streq(em->definition->name, "drm") ||
1013 eina_streq(em->definition->name, "gl_drm")))
1012 return; 1014 return;
1013 1015
1014 e->default_seat = evas_device_add_full(eo_e, "default", "The default seat", 1016 e->default_seat = evas_device_add_full(eo_e, "default", "The default seat",