Make hover gestures near edges easier to perform 23/208623/2
authorLukasz Wlazly <l.wlazly@partner.samsung.com>
Wed, 26 Jun 2019 13:45:04 +0000 (15:45 +0200)
committerLukasz Wlazly <l.wlazly@partner.samsung.com>
Thu, 29 Aug 2019 08:04:19 +0000 (10:04 +0200)
Change-Id: I84c539d8dabe77d7a3f4062f74b7f9cf2ea4cbd1

src/e_screen_reader_gestures.c

index dfb6b82..46e76c9 100644 (file)
@@ -827,6 +827,19 @@ _hover_gesture_timer_reset(Cover *cov, double time)
    cov->hover_gesture.timer = ecore_timer_add(time, _on_hover_timeout, cov);
 }
 
+static Eina_Bool
+_on_screen_edge(Cover *cov)
+{
+   E_Accessibility_Conf_Edd* conf = e_accessibility_get_configuration();
+   if (((cov->hover_gesture.x[0] < cov->zone.x + conf->gesture.quickpanel_area_size)
+         && (cov->hover_gesture.x[1] < cov->zone.x + conf->gesture.quickpanel_area_size))
+      || ((cov->hover_gesture.x[0] > cov->zone.x + cov->zone.w - conf->gesture.quickpanel_area_size)
+         && (cov->hover_gesture.x[1] > cov->zone.x + cov->zone.w - conf->gesture.quickpanel_area_size)))
+      return EINA_TRUE;
+
+   return EINA_FALSE;
+}
+
 static void
 _hover_gesture_mouse_down(Ecore_Event_Mouse_Button *ev, Cover *cov)
 {
@@ -859,14 +872,10 @@ _hover_gesture_mouse_down(Ecore_Event_Mouse_Button *ev, Cover *cov)
         cov->hover_gesture.y[1] = ev->root.y;
         cov->hover_gesture.finger[1] = ev->multi.device;
         cov->hover_gesture.n_fingers = 2;
-        E_Accessibility_Conf_Edd* conf = e_accessibility_get_configuration();
         _hover_gesture_timer_reset(cov, _e_mod_config->two_fingers_hover_longpress_timeout);
 
         /* Make Quickpanel Open Easy */
-        if (((cov->hover_gesture.y[0] < cov->zone.y + conf->gesture.quickpanel_area_size)
-             && (cov->hover_gesture.y[1] < cov->zone.y + conf->gesture.quickpanel_area_size)) ||
-            ((cov->hover_gesture.y[0] > cov->zone.y + cov->zone.h - conf->gesture.quickpanel_area_size)
-             && (cov->hover_gesture.y[1] > cov->zone.y + cov->zone.h - conf->gesture.quickpanel_area_size)))
+        if (_on_screen_edge(cov))
           {
              /* Do what _on_hover_timeout does */
              cov->hover_gesture.longpressed = EINA_TRUE;