#include <iostream>
// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/window-devel.h>
#include <dali/devel-api/atspi-interfaces/accessible.h>
#include <dali/devel-api/atspi-interfaces/component.h>
#include <dali/devel-api/atspi-interfaces/selection.h>
constexpr const char* VALUE_FORMAT_TEXT_VAL = "text";
constexpr const char* FORCE_CHILD_SEARCH_ATTR{"forceChildSearch"};
+bool IsSubWindow(Accessible* accessible)
+{
+ auto baseHandle = BridgeBase::GetWindow(accessible->GetInternalActor()).GetBaseHandle();
+ if(baseHandle)
+ {
+ auto window = Dali::Window::DownCast(baseHandle);
+ return DALI_LIKELY(Dali::DevelWindow::GetParent(window));
+ }
+ return false;
+}
+
bool SortVertically(Component* lhs, Component* rhs)
{
auto leftRect = lhs->GetExtents(CoordinateType::WINDOW);
auto accessible = FindSelf();
auto cType = static_cast<CoordinateType>(coordinateType);
- x -= mData->mExtentsOffset.first;
- y -= mData->mExtentsOffset.second;
+ const bool hasExtentsOffset = mData->mExtentsOffset.first != 0 || mData->mExtentsOffset.second != 0;
+ if(hasExtentsOffset && !IsSubWindow(accessible))
+ {
+ x -= mData->mExtentsOffset.first;
+ y -= mData->mExtentsOffset.second;
+ }
LOG() << "GetNavigableAtPoint: " << x << ", " << y << " type: " << coordinateType;
auto component = CalculateNavigableAccessibleAtPoint(accessible, {x, y}, cType, GET_NAVIGABLE_AT_POINT_MAX_RECURSION_DEPTH);
mApplication.mToolkitName = std::string{toolkitName};
}
+ /**
+ * @brief Gets the window to which this actor belongs (or an empty handle).
+ *
+ * @param actor The actor
+ * @return The window
+ */
+ static Dali::WeakHandle<Dali::Window> GetWindow(Dali::Actor actor);
+
protected:
// We use a weak handle in order not to keep a window alive forever if someone forgets to UnregisterDefaultLabel()
using DefaultLabelType = std::pair<Dali::WeakHandle<Dali::Window>, Dali::WeakHandle<Dali::Actor>>;
*/
void CompressDefaultLabels();
- /**
- * @brief Gets the window to which this actor belongs (or an empty handle).
- *
- * @param actor The actor
- * @return The window
- */
- static Dali::WeakHandle<Dali::Window> GetWindow(Dali::Actor actor);
-
protected:
BridgeBase();
virtual ~BridgeBase();