aboutsummaryrefslogtreecommitdiffstats
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
parentecore-drm: Fix mouse movement across multiple outputs (diff)
downloadefl-613e6ad934119d96b2c997d8aa93e18442a3578a.tar.gz
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>
-rw-r--r--src/lib/ecore_drm/ecore_drm_evdev.c23
-rw-r--r--src/lib/ecore_drm/ecore_drm_private.h1
2 files changed, 13 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)
libinput_device_config_tap_set_enabled(edev->device, tap);
}
+ ecore_drm_outputs_geometry_get(edev->seat->input->dev,
+ &edev->mouse.minx, &edev->mouse.miny,
+ &edev->mouse.maxw, &edev->mouse.maxh);
+
_device_output_set(edev);
_device_calibration_set(edev);
}
@@ -345,23 +349,20 @@ _device_pointer_motion(Ecore_Drm_Evdev *edev, struct libinput_event_pointer *eve
{
Ecore_Drm_Input *input;
Ecore_Event_Mouse_Move *ev;
- int x, y, w, h;
if (!(input = edev->seat->input)) return;
if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
- ecore_drm_outputs_geometry_get(input->dev, &x, &y, &w, &h);
-
- 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.ix < edev->mouse.minx)
+ edev->mouse.dx = edev->mouse.ix = edev->mouse.minx;
+ else if (edev->mouse.ix >= (edev->mouse.minx + edev->mouse.maxw))
+ edev->mouse.dx = edev->mouse.ix = (edev->mouse.minx + edev->mouse.maxw - 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);
+ if (edev->mouse.iy < edev->mouse.miny)
+ edev->mouse.dy = edev->mouse.iy = edev->mouse.miny;
+ else if (edev->mouse.iy >= (edev->mouse.miny + edev->mouse.maxh))
+ edev->mouse.dy = edev->mouse.iy = (edev->mouse.miny + edev->mouse.maxh - 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_private.h b/src/lib/ecore_drm/ecore_drm_private.h
index 0e21f10f71..16ef53e0ca 100644
--- a/src/lib/ecore_drm/ecore_drm_private.h
+++ b/src/lib/ecore_drm/ecore_drm_private.h
@@ -197,6 +197,7 @@ struct _Ecore_Drm_Evdev
struct
{
int ix, iy;
+ int minx, miny, maxw, maxh;
double dx, dy;
unsigned int last, prev;
double threshold;