From b41ed6a6f837d78f99beef3255c2d0be79c6d2dc Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Thu, 16 Apr 2015 12:35:36 -0400 Subject: [PATCH] ecore-drm: Fix mouse movement across multiple outputs Summary: When running E-Wl with multiple outputs, we could not previously move the mouse pointer across to the second output. This commit fixes that issue. @fix Signed-off-by: Chris Michael --- src/lib/ecore_drm/ecore_drm_evdev.c | 29 +++++++++++------------------ src/lib/ecore_drm/ecore_drm_output.c | 2 -- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/lib/ecore_drm/ecore_drm_evdev.c b/src/lib/ecore_drm/ecore_drm_evdev.c index cbf58f3..363c05c 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 { Ecore_Drm_Input *input; Ecore_Event_Mouse_Move *ev; - Ecore_Drm_Output *output; + int x, y, w, h; if (!(input = edev->seat->input)) return; if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return; - if ((output = edev->output)) - { - if (edev->mouse.ix < output->x) - edev->mouse.dx = edev->mouse.ix = output->x; - else if (edev->mouse.ix >= (output->x + output->current_mode->width)) - { - edev->mouse.dx = - edev->mouse.ix = (output->x + output->current_mode->width - 1); - } + ecore_drm_outputs_geometry_get(input->dev, &x, &y, &w, &h); - if (edev->mouse.iy < output->y) - edev->mouse.dy = edev->mouse.iy = output->y; - else if (edev->mouse.iy >= (output->y + output->current_mode->height)) - { - edev->mouse.dy = - edev->mouse.iy = (output->y + output->current_mode->height - 1); - } - } + if (edev->mouse.ix < x) + edev->mouse.dx = edev->mouse.ix = x; + else if (edev->mouse.ix >= (x + w)) + edev->mouse.dx = edev->mouse.ix = (x + w - 1); + + if (edev->mouse.iy < y) + edev->mouse.dy = edev->mouse.iy = y; + else if (edev->mouse.iy >= (y + h)) + edev->mouse.dy = edev->mouse.iy = (y + h - 1); ev->window = (Ecore_Window)input->dev->window; ev->event_window = (Ecore_Window)input->dev->window; diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c index 67bd68f..b59a66b 100644 --- a/src/lib/ecore_drm/ecore_drm_output.c +++ b/src/lib/ecore_drm/ecore_drm_output.c @@ -969,8 +969,6 @@ ecore_drm_outputs_geometry_get(Ecore_Drm_Device *dev, int *x, int *y, int *w, in EINA_LIST_FOREACH(dev->outputs, l, output) { if (output->cloned) continue; - ox += output->x; - oy += output->y; ow += MAX(ow, output->current_mode->width); oh = MAX(oh, output->current_mode->height); } -- 2.7.4