[AT-SPI] emit showing event for window 12/275412/1
authorShinwoo Kim <cinoo.kim@samsung.com>
Tue, 24 May 2022 12:04:18 +0000 (21:04 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 24 May 2022 12:04:18 +0000 (21:04 +0900)
For the multi-window case, we need to send 'showing' event when
the AT-SPI bridge turns on. So far, we have sent only 'activate' event
which is enough for the non-multi-window case.

And the 'mIsShown' does not care about the multi-window case.
If one window calls WindowShown, then other windows cannot send 'showing'
event because of the 'mIsShown'.

Change-Id: I501953e8dc1475550afc357293f21dd8fcc98620

dali/internal/accessibility/bridge/bridge-impl.cpp
dali/internal/window-system/common/window-impl.cpp

index 551a89a24f1291b7f244dfb935b0df7eab6360d9..4cde99288571b80326d4163bfb4a245b8d60087f 100644 (file)
@@ -76,7 +76,6 @@ class BridgeImpl : public virtual BridgeBase,
   DBus::DBusClient                                              mDirectReadingClient;
   bool                                                          mIsScreenReaderEnabled = false;
   bool                                                          mIsEnabled             = false;
-  bool                                                          mIsShown               = false;
   std::unordered_map<int32_t, std::function<void(std::string)>> mDirectReadingCallbacks;
   Dali::Actor                                                   mHighlightedActor;
   std::function<void(Dali::Actor)>                              mHighlightClearAction;
@@ -425,11 +424,10 @@ public:
    */
   void WindowShown(Dali::Window window) override
   {
-    if(!mIsShown && IsUp())
+    if(IsUp())
     {
       EmitShown(window);
     }
-    mIsShown = true;
   }
 
   /**
@@ -437,11 +435,10 @@ public:
    */
   void WindowHidden(Dali::Window window) override
   {
-    if(mIsShown && IsUp())
+    if(IsUp())
     {
       EmitHidden(window);
     }
-    mIsShown = false;
   }
 
   /**
@@ -449,7 +446,7 @@ public:
    */
   void WindowFocused(Dali::Window window) override
   {
-    if(mIsShown && IsUp())
+    if(IsUp())
     {
       EmitActivate(window);
     }
@@ -460,7 +457,7 @@ public:
    */
   void WindowUnfocused(Dali::Window window) override
   {
-    if(mIsShown && IsUp())
+    if(IsUp())
     {
       EmitDeactivate(window);
     }
index 2f1bd125956f597149dacb7515a65f0dcd478c3d..3d7dd3a007f60389f69ae9f07197ab8dcce6bd02 100644 (file)
@@ -956,9 +956,16 @@ void Window::OnAccessibilityEnabled()
   auto accessible = Accessibility::Accessible::Get(rootLayer);
   bridge->AddTopLevelWindow(accessible);
 
+  if(!mVisible || mIconified)
+  {
+    return;
+  }
+
+  Dali::Window handle(this);
+  bridge->WindowShown(handle);
+
   if(mFocused)
   {
-    Dali::Window handle(this);
     bridge->WindowFocused(handle);
   }
 }