ecore-drm: Center mouse pointer on an output when it gets created
authorChris Michael <cp.michael@samsung.com>
Wed, 4 Mar 2015 16:47:42 +0000 (11:47 -0500)
committerChris Michael <cp.michael@samsung.com>
Wed, 4 Mar 2015 16:49:44 +0000 (11:49 -0500)
Summary: This sets the initial mouse pointer position to be at the
center of an output.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_drm/ecore_drm_evdev.c

index 3f47101..a8383fa 100644 (file)
@@ -78,6 +78,13 @@ _device_output_set(Ecore_Drm_Evdev *edev)
         if (!(output = eina_list_nth(input->dev->outputs, 0))) return;
         edev->output = output;
      }
+
+   if (libinput_device_has_capability(edev->device, 
+                                      LIBINPUT_DEVICE_CAP_POINTER))
+     {
+        edev->mouse.dx = edev->output->current_mode->width / 2;
+        edev->mouse.dy = edev->output->current_mode->height / 2;
+     }
 }
 
 static void