summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm_evdev.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-04-16 12:47:29 -0400
committerChris Michael <cp.michael@samsung.com>2015-04-16 12:47:29 -0400
commit613e6ad934119d96b2c997d8aa93e18442a3578a (patch)
treeaffada192d3745cd9261482b2921bd13636c3d16 /src/lib/ecore_drm/ecore_drm_evdev.c
parentb41ed6a6f837d78f99beef3255c2d0be79c6d2dc (diff)
ecore-drm: Don't fetch output geometry on every mouse movement
Summary: This is a better way to allow mouse movement across multiple outputs as this does not require us to fetch output geometry on Every mouse movement (as before). @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm/ecore_drm_evdev.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_evdev.c b/src/lib/ecore_drm/ecore_drm_evdev.c
index 363c05c476..9f4651649a 100644
--- a/src/lib/ecore_drm/ecore_drm_evdev.c
+++ b/src/lib/ecore_drm/ecore_drm_evdev.c
@@ -98,6 +98,10 @@ _device_configure(Ecore_Drm_Evdev *edev)
98 libinput_device_config_tap_set_enabled(edev->device, tap); 98 libinput_device_config_tap_set_enabled(edev->device, tap);
99 } 99 }
100 100
101 ecore_drm_outputs_geometry_get(edev->seat->input->dev,
102 &edev->mouse.minx, &edev->mouse.miny,
103 &edev->mouse.maxw, &edev->mouse.maxh);
104
101 _device_output_set(edev); 105 _device_output_set(edev);
102 _device_calibration_set(edev); 106 _device_calibration_set(edev);
103} 107}
@@ -345,23 +349,20 @@ _device_pointer_motion(Ecore_Drm_Evdev *edev, struct libinput_event_pointer *eve
345{ 349{
346 Ecore_Drm_Input *input; 350 Ecore_Drm_Input *input;
347 Ecore_Event_Mouse_Move *ev; 351 Ecore_Event_Mouse_Move *ev;
348 int x, y, w, h;
349 352
350 if (!(input = edev->seat->input)) return; 353 if (!(input = edev->seat->input)) return;
351 354
352 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return; 355 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
353 356
354 ecore_drm_outputs_geometry_get(input->dev, &x, &y, &w, &h); 357 if (edev->mouse.ix < edev->mouse.minx)
355 358 edev->mouse.dx = edev->mouse.ix = edev->mouse.minx;
356 if (edev->mouse.ix < x) 359 else if (edev->mouse.ix >= (edev->mouse.minx + edev->mouse.maxw))
357 edev->mouse.dx = edev->mouse.ix = x; 360 edev->mouse.dx = edev->mouse.ix = (edev->mouse.minx + edev->mouse.maxw - 1);
358 else if (edev->mouse.ix >= (x + w))
359 edev->mouse.dx = edev->mouse.ix = (x + w - 1);
360 361
361 if (edev->mouse.iy < y) 362 if (edev->mouse.iy < edev->mouse.miny)
362 edev->mouse.dy = edev->mouse.iy = y; 363 edev->mouse.dy = edev->mouse.iy = edev->mouse.miny;
363 else if (edev->mouse.iy >= (y + h)) 364 else if (edev->mouse.iy >= (edev->mouse.miny + edev->mouse.maxh))
364 edev->mouse.dy = edev->mouse.iy = (y + h - 1); 365 edev->mouse.dy = edev->mouse.iy = (edev->mouse.miny + edev->mouse.maxh - 1);
365 366
366 ev->window = (Ecore_Window)input->dev->window; 367 ev->window = (Ecore_Window)input->dev->window;
367 ev->event_window = (Ecore_Window)input->dev->window; 368 ev->event_window = (Ecore_Window)input->dev->window;