Handle Quickpanel 81/248781/7
authorShinwoo Kim <cinoo.kim@samsung.com>
Wed, 2 Dec 2020 07:06:06 +0000 (16:06 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Thu, 3 Dec 2020 11:47:14 +0000 (20:47 +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

Change-Id: I831a22dc01f04278c453398926af0c9e65b9aebd

src/navigator.c

index 7d36a5302aa6a48239d003397b18acd6826bccf1..f94f65ae260c6d9a1a8db10e17bba54ace50284f 100644 (file)
 
 #define DEBUG_MODE
 
+/* following definition is referring to the enlightenment enum such as
+E_SERVICE_QUICKPANEL_TYPE_SYSTEM_DEFAULT, E_SERVICE_QUICKPANEL_TYPE_APPS_MENU.
+following line could be removed when DALi atspi is working */
+#define QUICKPANEL_TYPE_SYSTEM_DEFAULT 1
+#define QUICKPANEL_TYPE_APPS_MENU 3
+
 TIZEN_PROD_STATIC void _highlight_on_slider(Eina_Bool is_slider);
 
 typedef struct {
@@ -83,6 +89,17 @@ struct _NavigatorData {
        App_Tracker_Data *app_tracker_data;
        KeyboardTrackerData *keyboard_tracker_data;
        Eldbus_Connection *connection;
+
+       /* quickpanel_info has information of quickpanel type applications.
+       it is using a bit field as below;
+
+        - 0000: both quickpanel and allapps are hidden
+        - 0010: quickpanel is visible, allapps is hidden
+        - 1000: quickpanel is hidden, allapps is visible
+        - 1010: both quickpanel and allapps are visible
+
+       following line could be removed when DALi atspi is working */
+       unsigned char quickpanel_info;
 };
 
 char *state_to_char(AtspiStateType state)
@@ -2190,6 +2207,20 @@ TIZEN_PROD_STATIC void on_gesture_detected(void *data, const Eldbus_Message *msg
                return;
        }
 
+       /* TODO:
+       check current quickpanel status, and decide to use gesture or not
+       if AllApps(NUI) is top, then screen-reader does not use gesutre.
+
+       - QUICKPANEL_TYPE_SYSTEM_DEFAULT: quickpanel
+       - QUICKPANEL_TYPE_APPS_MENU: allapps
+
+       following line could be removed when DALi atspi is working */
+       if ((nd->quickpanel_info & 1 << QUICKPANEL_TYPE_APPS_MENU) &&
+           !(nd->quickpanel_info & 1 << QUICKPANEL_TYPE_SYSTEM_DEFAULT)) {
+               DEBUG("Apps menu type quickpanel is top");
+               return;
+       }
+
        AtspiAccessible *current_accessible = nd->current_obj;
        Eina_Bool keyboard_status;
        DEBUG("In _on_gestures_detected callback");
@@ -2429,6 +2460,41 @@ TIZEN_PROD_STATIC void on_gesture_detected(void *data, const Eldbus_Message *msg
        g_free(info);
 }
 
+/* this function could be removed when DALi atspi is working */
+TIZEN_PROD_STATIC void quickpanel_changed_cb(void *data, const Eldbus_Message *msg)
+{
+       NavigatorData *nd = (NavigatorData *)data;
+
+       if (nd == NULL) {
+               ERROR("NULL context");
+               return;
+       }
+
+       unsigned int type = 0;
+       unsigned int state = 0;
+
+       if (!msg) {
+               DEBUG("Incoming message is empty");
+               return;
+       }
+
+       if (!eldbus_message_arguments_get(msg, "uu", &type, &state)) {
+               DEBUG("Getting message arguments failed");
+               return;
+       }
+
+       if (state) {
+               /* visible */
+               nd->quickpanel_info |= 1 << type;
+       } else {
+               /* hidden */
+               nd->quickpanel_info &= ~(1 << type);
+       }
+
+       DEBUG("Quickpanel changed type(%u) state(%u) info(%x)", type, state, nd->quickpanel_info);
+
+}
+
 TIZEN_PROD_STATIC void _send_app_gesture_support( const char* app_gesture_support )
 {
        Eldbus_Connection *conn = NULL;
@@ -2593,6 +2659,11 @@ void navigator_gestures_tracker_register(NavigatorData *nd, GestureCB gesture_cb
        if (!proxy) ERROR("Getting proxy failed");
        if (!eldbus_proxy_signal_handler_add(proxy, "GestureDetected", gesture_cb, nd))
                DEBUG("No signal handler returned");
+
+        /* following line could be removed when DALi atspi is working */
+       if (!eldbus_proxy_signal_handler_add(proxy, "QuickpanelChanged", quickpanel_changed_cb, nd))
+               DEBUG("No signal handler returned for QuickpanelChanged signal");
+
        DEBUG("Callback registration successful");
        return;
 }