[Tizen] Allow duplicate showing event for modal and window 81/317481/1 accepted/tizen/7.0/unified/20240913.153021
authorYoungsun Suh <youngsun.suh@samsung.com>
Wed, 11 Sep 2024 01:42:12 +0000 (10:42 +0900)
committerYoungsun Suh <youngsun.suh@samsung.com>
Wed, 11 Sep 2024 01:42:12 +0000 (10:42 +0900)
Change-Id: I3ef31de266ebebe6188327922372da096b450c0b

dali/internal/accessibility/bridge/accessible.cpp

index 79c7594..f837a35 100644 (file)
@@ -40,6 +40,17 @@ bool UpdateLastEmitted(std::map<State, int>& lastEmitted, State state, int newVa
   return inserted || updated;
 }
 
+bool RoleTriggersContextRebuilding(Role role)
+{
+  return role == Role::POPUP_MENU || role == Role::PANEL || role == Role::DIALOG || role == Role::PAGE_TAB || role == Role::WINDOW;
+}
+
+// Allowing duplicate showing event for some roles as it used to rebuild context after switching default label in Accessibility V1.
+bool ShouldForceEmit(Accessible* accessible, State state)
+{
+  return state == State::SHOWING && RoleTriggersContextRebuilding(accessible->GetRole());
+}
+
 } // namespace
 
 Accessible::Accessible()
@@ -67,7 +78,7 @@ void Accessible::EmitStateChanged(State state, int newValue, int reserved)
 {
   if(auto bridgeData = GetBridgeData())
   {
-    if(UpdateLastEmitted(mLastEmittedState, state, newValue))
+    if(UpdateLastEmitted(mLastEmittedState, state, newValue) || ShouldForceEmit(this, state))
     {
       bridgeData->mBridge->EmitStateChanged(this, state, newValue, reserved);
     }