tzsh_quickpanel_service: add code to handle the scroll lock of quickpanel service 89/115389/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Fri, 17 Feb 2017 15:18:42 +0000 (00:18 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Fri, 17 Feb 2017 15:18:42 +0000 (00:18 +0900)
Change-Id: I716e80854cb990a28ca0e30eda240fb8187de5e4

src/bin/e_policy_wl.c
src/bin/services/e_service_quickpanel.c
src/bin/services/e_service_quickpanel.h

index 876e773ca7f24f4463229a0b729a973f547f5f45..751fe32c085db9fb9f3596695c4400b8a33466ca 100644 (file)
@@ -3396,12 +3396,28 @@ _tzsh_srv_qp_cb_effect_type_set(struct wl_client *client EINA_UNUSED, struct wl_
 #undef EC
 }
 
+static void
+_tzsh_srv_qp_cb_scroll_lock_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t lock)
+{
+   E_Policy_Wl_Tzsh_Srv *tzsh_srv;
+
+   tzsh_srv = wl_resource_get_user_data(resource);
+
+   EINA_SAFETY_ON_NULL_RETURN(tzsh_srv);
+   EINA_SAFETY_ON_NULL_RETURN(tzsh_srv->tzsh);
+
+#define EC  tzsh_srv->tzsh->ec
+   EINA_SAFETY_ON_NULL_RETURN(EC);
+   e_service_quickpanel_scroll_lock_set(EC, lock);
+#undef EC
+}
 
 static const struct tws_service_quickpanel_interface _tzsh_srv_qp_iface =
 {
    _tzsh_srv_qp_cb_destroy,
    _tzsh_srv_qp_cb_msg,
-   _tzsh_srv_qp_cb_effect_type_set
+   _tzsh_srv_qp_cb_effect_type_set,
+   _tzsh_srv_qp_cb_scroll_lock_set,
 };
 
 static void
index b45314215e57ccdefce4563e2e613137adfac6c6..b19d83224c5e980ab72325c159e4e073d259293d 100644 (file)
@@ -85,6 +85,7 @@ struct _E_Policy_Quickpanel
 
    Eina_Bool show_block;
    Eina_Bool need_scroll_update;
+   Eina_Bool scroll_lock;
 };
 
 struct _Mover_Data
@@ -795,6 +796,10 @@ _region_obj_cb_gesture_start(void *data, Evas_Object *handler, int x, int y, uns
        (_quickpanel_send_gesture_to_indicator()))
      return;
 
+   // check quickpanel service window's scroll lock state
+   if (qp->scroll_lock)
+     return;
+
    /* Do not show and scroll the quickpanel window if the qp_client winodw
     * which is placed at the below of the quickpanel window doesn't want
     * to show and scroll the quickpanel window.
@@ -1627,6 +1632,28 @@ e_service_quickpanel_effect_type_set(E_Client *ec, E_Service_Quickpanel_Effect_T
      }
 }
 
+EINTERN void
+e_service_quickpanel_scroll_lock_set(E_Client *ec, Eina_Bool lock)
+{
+   E_Policy_Quickpanel *qp;
+
+   if (qp_mgr_funcs && qp_mgr_funcs->quickpanel_scroll_lock_set)
+     {
+        qp_mgr_funcs->quickpanel_scroll_lock_set(ec, lock);
+        return;
+     }
+
+   qp = _quickpanel_get();
+   if (!qp) return;
+   if ((qp->ec != ec)) return;
+
+   if (qp->scroll_lock == lock)
+     return;
+
+   ELOGF("QUICKPANEL", "Scroll lock is set to %d", NULL, NULL, lock);
+   qp->scroll_lock = lock;
+}
+
 E_API E_Client *
 e_service_quickpanel_client_get(void)
 {
@@ -1902,6 +1929,7 @@ e_service_quickpanel_module_func_set(E_QP_Mgr_Funcs *fp)
    qp_mgr_funcs->quickpanel_handler_object_add = fp->quickpanel_handler_object_add;
    qp_mgr_funcs->quickpanel_handler_object_del = fp->quickpanel_handler_object_del;
    qp_mgr_funcs->quickpanel_effect_type_set = fp->quickpanel_effect_type_set;
+   qp_mgr_funcs->quickpanel_scroll_lock_set = fp->quickpanel_scroll_lock_set;
 
    qp_mgr_funcs->qp_visible_get = fp->qp_visible_get;
    qp_mgr_funcs->qp_orientation_get = fp->qp_orientation_get;
index d4130f80c2b17523ea7d56c19f594c06d391047a..87f4c2f461e4e06bf0d174a86e3db7cd2b5bc414 100644 (file)
@@ -23,6 +23,7 @@ struct _E_QP_Mgr_Funcs
    Evas_Object*  (*quickpanel_handler_object_add)(E_Client *ec, int x, int y, int w, int h);
    void          (*quickpanel_handler_object_del)(Evas_Object *handler);
    void          (*quickpanel_effect_type_set)(E_Client *ec, E_Service_Quickpanel_Effect_Type type);
+   void          (*quickpanel_scroll_lock_set)(E_Client *ec, Eina_Bool lock);
 
    Eina_Bool    (*qp_visible_get)(void);
    int          (*qp_orientation_get)(void);
@@ -46,6 +47,7 @@ EINTERN Eina_Bool     e_service_quickpanel_region_set(int type, int angle, Eina_
 EINTERN Evas_Object  *e_service_quickpanel_handler_object_add(E_Client *ec, int x, int y, int w, int h);
 EINTERN void          e_service_quickpanel_handler_object_del(Evas_Object *handler);
 EINTERN void          e_service_quickpanel_effect_type_set(E_Client *ec, E_Service_Quickpanel_Effect_Type type);
+EINTERN void          e_service_quickpanel_scroll_lock_set(E_Client *ec, Eina_Bool lock);
 
 EINTERN Eina_Bool    e_qp_visible_get(void);
 EINTERN int          e_qp_orientation_get(void);