Retrieve last events only if it has body 24/299324/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 26 Sep 2023 05:26:04 +0000 (14:26 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 26 Sep 2023 05:26:04 +0000 (14:26 +0900)
Let we make last events retrieve only if it really have
meanful informations.

TODO : This is kind of trick. We should fix NUI side bug somedays

Change-Id: I676bbc3de8ecc1c0291c874504fb68acd7551803
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-csharp-binder/dali-adaptor/window-wrap.cpp

index 40d6cf5..741975c 100644 (file)
@@ -2947,7 +2947,12 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Window_InternalRetrievingLastKeyEvent(vo
   }
   {
     try {
-      (*keyEvent) = *((Dali::KeyEvent *)&Dali::DevelWindow::GetLastKeyEvent(*window));
+      // TODO : To make ensure that inputed handle have body, let we retrieving last event only if it exist.
+      auto& lastKeyEvent = Dali::DevelWindow::GetLastKeyEvent(*window);
+      if(lastKeyEvent)
+      {
+        (*keyEvent) = *((Dali::KeyEvent *)&lastKeyEvent);
+      }
     } CALL_CATCH_EXCEPTION();
   }
 }
@@ -2967,7 +2972,12 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Window_InternalRetrievingLastTouchEvent(
   }
   {
     try {
-      (*touchEvent) = *((Dali::TouchEvent *)&Dali::DevelWindow::GetLastTouchEvent(*window));
+      // TODO : To make ensure that key handle have body, let we retrieving last event only if it exist.
+      auto& lastTouchEvent = Dali::DevelWindow::GetLastTouchEvent(*window);
+      if(lastTouchEvent)
+      {
+        (*touchEvent) = *((Dali::TouchEvent *)&lastTouchEvent);
+      }
     } CALL_CATCH_EXCEPTION();
   }
 }
@@ -2987,7 +2997,12 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Window_InternalRetrievingLastHoverEvent(
   }
   {
     try {
-      (*hoverEvent) = *((Dali::HoverEvent *)&Dali::DevelWindow::GetLastHoverEvent(*window));
+      // TODO : To make ensure that key handle have body, let we retrieving last event only if it exist.
+      auto& lastHoverEvent = Dali::DevelWindow::GetLastHoverEvent(*window);
+      if(lastHoverEvent)
+      {
+        (*hoverEvent) = *((Dali::HoverEvent *)&lastHoverEvent);
+      }
     } CALL_CATCH_EXCEPTION();
   }
 }