summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm_evdev.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm/ecore_drm_evdev.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_evdev.c b/src/lib/ecore_drm/ecore_drm_evdev.c
index cbf58f3d4e..363c05c476 100644
--- a/src/lib/ecore_drm/ecore_drm_evdev.c
+++ b/src/lib/ecore_drm/ecore_drm_evdev.c
@@ -345,30 +345,23 @@ _device_pointer_motion(Ecore_Drm_Evdev *edev, struct libinput_event_pointer *eve
345{ 345{
346 Ecore_Drm_Input *input; 346 Ecore_Drm_Input *input;
347 Ecore_Event_Mouse_Move *ev; 347 Ecore_Event_Mouse_Move *ev;
348 Ecore_Drm_Output *output; 348 int x, y, w, h;
349 349
350 if (!(input = edev->seat->input)) return; 350 if (!(input = edev->seat->input)) return;
351 351
352 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return; 352 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
353 353
354 if ((output = edev->output)) 354 ecore_drm_outputs_geometry_get(input->dev, &x, &y, &w, &h);
355 {
356 if (edev->mouse.ix < output->x)
357 edev->mouse.dx = edev->mouse.ix = output->x;
358 else if (edev->mouse.ix >= (output->x + output->current_mode->width))
359 {
360 edev->mouse.dx =
361 edev->mouse.ix = (output->x + output->current_mode->width - 1);
362 }
363 355
364 if (edev->mouse.iy < output->y) 356 if (edev->mouse.ix < x)
365 edev->mouse.dy = edev->mouse.iy = output->y; 357 edev->mouse.dx = edev->mouse.ix = x;
366 else if (edev->mouse.iy >= (output->y + output->current_mode->height)) 358 else if (edev->mouse.ix >= (x + w))
367 { 359 edev->mouse.dx = edev->mouse.ix = (x + w - 1);
368 edev->mouse.dy = 360
369 edev->mouse.iy = (output->y + output->current_mode->height - 1); 361 if (edev->mouse.iy < y)
370 } 362 edev->mouse.dy = edev->mouse.iy = y;
371 } 363 else if (edev->mouse.iy >= (y + h))
364 edev->mouse.dy = edev->mouse.iy = (y + h - 1);
372 365
373 ev->window = (Ecore_Window)input->dev->window; 366 ev->window = (Ecore_Window)input->dev->window;
374 ev->event_window = (Ecore_Window)input->dev->window; 367 ev->event_window = (Ecore_Window)input->dev->window;