e_service_quickpanel: check the window is placed to indicator's position while starti... 10/115410/1 accepted/tizen/3.0/common/20170220.130412 accepted/tizen/3.0/ivi/20170220.013602 accepted/tizen/3.0/mobile/20170220.013321 accepted/tizen/3.0/tv/20170220.013414 accepted/tizen/3.0/wearable/20170220.013458 accepted/tizen/common/20170220.144131 accepted/tizen/ivi/20170220.224409 accepted/tizen/mobile/20170220.224326 accepted/tizen/tv/20170220.224340 accepted/tizen/wearable/20170220.224354 submit/tizen/20170220.021920 submit/tizen_3.0/20170219.082221
authorDoyoun Kang <doyoun.kang@samsung.com>
Sun, 19 Feb 2017 08:12:06 +0000 (17:12 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Sun, 19 Feb 2017 08:12:06 +0000 (17:12 +0900)
Change-Id: I520c58762318425273791c17b2ecaea90dc36c24

src/bin/services/e_service_quickpanel.c

index b19d83224c5e980ab72325c159e4e073d259293d..dcb2b27efe4b49cfc5b4fa62f7ddfa4186b9edb4 100644 (file)
@@ -780,6 +780,10 @@ _region_obj_cb_gesture_start(void *data, Evas_Object *handler, int x, int y, uns
    E_Policy_Quickpanel *qp;
    E_QP_Client *qp_client;
    E_Client *focused;
+   E_Client *pos_ec = NULL;
+   E_Desk *desk = NULL;
+   int indi_x, indi_y, indi_w, indi_h;
+   const int sensitivity = 50;
    Eina_Bool res;
 
    qp = data;
@@ -792,9 +796,62 @@ _region_obj_cb_gesture_start(void *data, Evas_Object *handler, int x, int y, uns
    if (e_object_is_del(E_OBJECT(qp->ec)))
      return;
 
-   if ((handler == qp->indi_obj) &&
-       (_quickpanel_send_gesture_to_indicator()))
-     return;
+   desk = e_desk_current_get(qp->ec->zone);
+   if (desk)
+     pos_ec = e_client_under_position_get(desk, x, y, NULL);
+
+   if (!pos_ec)
+     {
+        ELOGF("QUICKPANEL", "NO visible client under pos(%d,%d)", NULL, NULL, x, y);
+        return;
+     }
+
+   if (handler == qp->indi_obj)
+     {
+        int ix, iy, iw, ih;
+
+        e_service_region_rectangle_get(qp->indi_obj, qp->rotation, &indi_x, &indi_y, &indi_w, &indi_h);
+        switch (qp->rotation)
+          {
+           case E_POLICY_ANGLE_MAP_90:
+              ix = pos_ec->x;
+              iy = pos_ec->y;
+              iw = indi_w + sensitivity;
+              ih = pos_ec->h;
+              break;
+           case E_POLICY_ANGLE_MAP_180:
+              ix = pos_ec->x;
+              iy = pos_ec->y + pos_ec->h - (indi_h + sensitivity);
+              iw = pos_ec->w;
+              ih = indi_h + sensitivity;
+              break;
+           case E_POLICY_ANGLE_MAP_270:
+              ix = pos_ec->x + pos_ec->w - (indi_w + sensitivity);
+              iy = pos_ec->y;
+              iw = indi_w + sensitivity;
+              ih = pos_ec->h;
+              break;
+           case E_POLICY_ANGLE_MAP_0:
+           default:
+              ix = pos_ec->x;
+              iy = pos_ec->y;
+              iw = pos_ec->w;
+              ih = indi_h + sensitivity;
+              break;
+          }
+
+        if (!E_INSIDE(x, y, ix, iy, iw, ih))
+          {
+             ELOGF("QUICKPANEL", "NOT in indicator area", NULL, NULL);
+             return;
+          }
+
+        if (_quickpanel_send_gesture_to_indicator())
+          {
+             ELOGF("QUICKPANEL", "SEND to change indicator state", NULL, NULL);
+             return;
+          }
+     }
 
    // check quickpanel service window's scroll lock state
    if (qp->scroll_lock)