Handle Quickpanel 82/248782/5 accepted/tizen/6.5/unified/20211028.115204 accepted/tizen/unified/20201208.123226 submit/tizen/20201206.210050 submit/tizen_6.5/20211028.163101 tizen_6.5.m2_release
authorShinwoo Kim <cinoo.kim@samsung.com>
Wed, 2 Dec 2020 07:10:01 +0000 (16:10 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Thu, 3 Dec 2020 11:48:10 +0000 (20:48 +0900)
There are different type of quickpanel as below

 - E_QUICKPANEL_TYPE_SYSTEM_DEFAULT
 - E_QUICKPANEL_TYPE_CONTEXT_MENU
 - E_QUICKPANEL_TYPE_APPS_MENU

Thf FHUB AllApps is quickpanel type applcation and
it is DALi application which does not support AT-SPI.

So if the AllApps is on top, then screen-reader should NOT
consume 'GestureDetected' signal.

Refer to follwoing for more cases;
 - https://github.sec.samsung.net/TizenNativeUI/Graphics/issues/1281

So screen-reader module needs to notify quickpanel state.

Change-Id: I832624873370ba47c693c5e8de9bb34a3c63be7e

src/e_mod_main.c
src/e_mod_main.h

index b031c4c..8cb00f0 100644 (file)
@@ -23,6 +23,7 @@ static Eina_Bool g_gesture_navi;
 static Eina_List *handlers;
 static Eldbus_Connection *conn;
 static Ecore_Event_Handler *dbus_init_done_handler;
+static Ecore_Event_Handler *quickpanel_handler;
 
 EAPI E_Module_Api e_modapi =
 {
@@ -112,6 +113,7 @@ static const Eldbus_Signal signals[] = {
    [BACK_BUTTON_UP_SIGNAL] = {"BackButtonUp", 0, 0},
    [MENU_MOUSE_DOWN_SIGNAL] = {"MenuMouseDown", ELDBUS_ARGS({"i", "x"}, {"i", "y"}), 0},
    [MENU_MOUSE_UP_SIGNAL] = {"MenuMouseUp", ELDBUS_ARGS({"i", "x"}, {"i", "y"}), 0},
+   [QUICKPANEL_CHANGED_SIGNAL] = {"QuickpanelChanged", ELDBUS_ARGS({"u", "type"}, {"u", "state"}), 0},
    { }
 };
 
@@ -709,6 +711,54 @@ void _e_mod_atspi_vconf_shutdown(void)
      }
 }
 
+static Eina_Bool
+_quickpanel_state_changed(void *data, int type, void *event)
+{
+   E_Client *ec;
+   unsigned int visible_state;
+   E_Service_Quickpanel_Type qp_type;
+   E_Event_Client_Property *ev = event;
+
+   if (!ev) return ECORE_CALLBACK_PASS_ON;
+
+   /* event info
+      - ec : quickpanel service ec
+      - property : visible state (0 is hidden, 1 is shown)
+   */
+   ec = ev->ec;
+   visible_state = ev->property;   // 0: hidden, 1: shown
+
+   qp_type = e_policy_quickpanel_type_get(ec);
+   /* type info
+      - E_SERVICE_QUICKPANEL_TYPE_SYSTEM_DEFAULT : quickpanel
+      - E_SERVICE_QUICKPANEL_TYPE_CONTEXT_MENU   : inside ???
+      - E_SERVICE_QUICKPANEL_TYPE_APPS_MENU      : apps menu
+   */
+
+   eldbus_service_signal_emit(g_context->iface, QUICKPANEL_CHANGED_SIGNAL, qp_type,
+                              visible_state);
+
+   return ECORE_CALLBACK_PASS_ON;
+
+}
+
+int _e_mod_quickpanel_handler_init(void)
+{
+   DEBUG("quickpanel handler init");
+   quickpanel_handler = ecore_event_handler_add(E_EVENT_POLICY_QUICKPANEL_VISIBLE_STATE_CHANGE,
+                                                _quickpanel_state_changed, NULL);
+
+   if (!dbus_init_done_handler) return EINA_FALSE;
+
+   return EINA_TRUE;
+}
+
+void _e_mod_quickpanel_handler_shutdown()
+{
+   DEBUG("quickpanel handler shutdown");
+   E_FREE_FUNC(quickpanel_handler, ecore_event_handler_del);
+}
+
 EAPI void *
 e_modapi_init(E_Module *m)
 {
@@ -720,9 +770,18 @@ e_modapi_init(E_Module *m)
       return NULL;
    }
 
+   if (!_e_mod_quickpanel_handler_init())
+   {
+      ERROR("quickpanel handler initialization failed.");
+      _e_mod_atspi_dbus_shutdown();
+      _e_mod_log_shutdown();
+      return NULL;
+   }
+
    if (!_e_mod_atspi_vconf_init())
    {
       ERROR("AT-SPI vconf initialization failed.");
+      _e_mod_quickpanel_handler_shutdown();
       _e_mod_atspi_dbus_shutdown();
       _e_mod_log_shutdown();
       return NULL;
@@ -737,6 +796,7 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED)
 {
    e_accessibility_conf_shutdown();
    _e_mod_atspi_vconf_shutdown();
+   _e_mod_quickpanel_handler_shutdown();
    _e_mod_atspi_dbus_shutdown();
    _e_mod_log_shutdown();
    return 1;
index b72163d..0963d5b 100644 (file)
@@ -19,7 +19,8 @@ typedef enum signal_type_ {
        BACK_BUTTON_DOWN_SIGNAL,
        BACK_BUTTON_UP_SIGNAL,
        MENU_MOUSE_DOWN_SIGNAL,
-       MENU_MOUSE_UP_SIGNAL
+       MENU_MOUSE_UP_SIGNAL,
+       QUICKPANEL_CHANGED_SIGNAL
 } signal_type;
 
-#endif//__E_MOD_MAIN_H__
\ No newline at end of file
+#endif//__E_MOD_MAIN_H__