summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm_evdev.c
diff options
context:
space:
mode:
authorBoram Park <boram1288.park@samsung.com>2015-04-29 08:54:03 -0400
committerChris Michael <cp.michael@samsung.com>2015-04-29 08:54:03 -0400
commit5c7cfdc133c1edc21b8ece39bd306d0eace623da (patch)
treeea5d442692e4ab3f657e421b6564be590f54ef16 /src/lib/ecore_drm/ecore_drm_evdev.c
parent648091a1ad423a2b1fcdbe40c64884bc917e6fba (diff)
ecore_drm: send a fake motion event to let other know the initial pos of mouse
Summary: At the first time after finishing booting, the position of mouse cursor is in the center of screen. But e doesn't know it. ecore_drm should let e know the initial position of cursor by sending a fake motino event. Reviewers: devilhorns, ManMower, zmike, raster, gwanglim Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2410
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm/ecore_drm_evdev.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_evdev.c b/src/lib/ecore_drm/ecore_drm_evdev.c
index c99597548c..2e4ada101a 100644
--- a/src/lib/ecore_drm/ecore_drm_evdev.c
+++ b/src/lib/ecore_drm/ecore_drm_evdev.c
@@ -5,6 +5,8 @@
5#include "ecore_drm_private.h" 5#include "ecore_drm_private.h"
6#include <ctype.h> 6#include <ctype.h>
7 7
8static void _device_modifiers_update(Ecore_Drm_Evdev *edev);
9
8static void 10static void
9_device_calibration_set(Ecore_Drm_Evdev *edev) 11_device_calibration_set(Ecore_Drm_Evdev *edev)
10{ 12{
@@ -78,8 +80,40 @@ _device_output_set(Ecore_Drm_Evdev *edev)
78 if (libinput_device_has_capability(edev->device, 80 if (libinput_device_has_capability(edev->device,
79 LIBINPUT_DEVICE_CAP_POINTER)) 81 LIBINPUT_DEVICE_CAP_POINTER))
80 { 82 {
83 Ecore_Drm_Input *input;
84 Ecore_Event_Mouse_Move *ev;
85
81 edev->mouse.dx = edev->output->current_mode->width / 2; 86 edev->mouse.dx = edev->output->current_mode->width / 2;
82 edev->mouse.dy = edev->output->current_mode->height / 2; 87 edev->mouse.dy = edev->output->current_mode->height / 2;
88
89 /* send a fake motion event to let other know the initial pos of mouse */
90 if (!(input = edev->seat->input)) return;
91 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
92
93 ev->window = (Ecore_Window)input->dev->window;
94 ev->event_window = (Ecore_Window)input->dev->window;
95 ev->root_window = (Ecore_Window)input->dev->window;
96
97 _device_modifiers_update(edev);
98 ev->modifiers = edev->xkb.modifiers;
99 ev->same_screen = 1;
100
101 ev->x = edev->mouse.dx;
102 ev->y = edev->mouse.dy;
103 ev->root.x = ev->x;
104 ev->root.y = ev->y;
105 ev->multi.device = edev->mt_slot;
106 ev->multi.radius = 1;
107 ev->multi.radius_x = 1;
108 ev->multi.radius_y = 1;
109 ev->multi.pressure = 1.0;
110 ev->multi.angle = 0.0;
111 ev->multi.x = ev->x;
112 ev->multi.y = ev->y;
113 ev->multi.root.x = ev->x;
114 ev->multi.root.y = ev->y;
115
116 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
83 } 117 }
84} 118}
85 119