summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-04-16 12:35:36 -0400
committerChris Michael <cp.michael@samsung.com>2015-04-16 12:35:36 -0400
commitb41ed6a6f837d78f99beef3255c2d0be79c6d2dc (patch)
tree4ab8adc1ac02b21d40b15320d5e47f8edf76e9ea /src/lib
parent6d243f567200b33a6bbe5e0bc897c59827b329df (diff)
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 <cp.michael@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm/ecore_drm_evdev.c29
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c2
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 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;
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index 67bd68f56d..b59a66b73c 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
969 EINA_LIST_FOREACH(dev->outputs, l, output) 969 EINA_LIST_FOREACH(dev->outputs, l, output)
970 { 970 {
971 if (output->cloned) continue; 971 if (output->cloned) continue;
972 ox += output->x;
973 oy += output->y;
974 ow += MAX(ow, output->current_mode->width); 972 ow += MAX(ow, output->current_mode->width);
975 oh = MAX(oh, output->current_mode->height); 973 oh = MAX(oh, output->current_mode->height);
976 } 974 }