Updating non-ecore X window-system with new API 23/302723/1
authorDavid Steele <david.steele@samsung.com>
Tue, 12 Dec 2023 16:00:36 +0000 (16:00 +0000)
committerDavid Steele <david.steele@samsung.com>
Tue, 12 Dec 2023 16:00:36 +0000 (16:00 +0000)
Change-Id: I455f960b088ac0d99dcf2af9d3caff10cfb31688

dali/internal/window-system/x11/window-system-x.cpp

index b48a7ef..0f5f66c 100644 (file)
@@ -20,6 +20,9 @@
 
 // INTERNAL HEADERS
 #include <dali/devel-api/adaptor-framework/keyboard.h>
+#include <dali/integration-api/adaptor-framework/adaptor.h>
+#include <dali/integration-api/adaptor-framework/scene-holder.h>
+#include <dali/integration-api/debug.h>
 #include <dali/internal/system/common/file-descriptor-monitor.h>
 #include <dali/internal/system/common/system-factory.h>
 #include <dali/internal/window-system/common/window-system.h>
@@ -139,6 +142,7 @@ bool GetWindowProperty(::Display* display, ::Window window, ::Atom property, ::A
 namespace WindowSystem
 {
 static WindowSystemX* gWindowSystem{nullptr};
+static bool           gGeometryHittest = false;
 
 /**
  * Initialize the window system (currently run from the first window that gets created)
@@ -926,7 +930,7 @@ void WindowSystemX::Show(::Window window)
 
 void WindowSystemX::Hide(::Window window)
 {
-  Window       rootWindow = window;
+  ::Window     rootWindow = window;
   int          x, y;
   unsigned int width, height, border, depth;
   if(ScreenCount(mImpl->mDisplay) == 1)
@@ -1094,6 +1098,28 @@ bool GetKeyboardVerticalRepeatInfo(float& rate, float& delay)
   return false;
 }
 
+void SetGeometryHittestEnabled(bool enable)
+{
+  DALI_LOG_RELEASE_INFO("GeometryHittest : %d \n", enable);
+  gGeometryHittest = enable;
+  if(gGeometryHittest)
+  {
+    Dali::SceneHolderList sceneHolders = Dali::Adaptor::Get().GetSceneHolders();
+    for(auto iter = sceneHolders.begin(); iter != sceneHolders.end(); ++iter)
+    {
+      if(*iter)
+      {
+        (*iter).SetGeometryHittestEnabled(enable);
+      }
+    }
+  }
+}
+
+bool IsGeometryHittestEnabled()
+{
+  return gGeometryHittest;
+}
+
 } // namespace WindowSystem
 
 } // namespace Adaptor