Do not send duplicated cancel 84/170484/2
authorhyunho <hhstark.kang@samsung.com>
Tue, 20 Feb 2018 08:04:04 +0000 (17:04 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Mon, 5 Mar 2018 02:16:50 +0000 (02:16 +0000)
Change-Id: I03208d6fc2c9776c957460448f2fa777c3f3b930
Signed-off-by: hyunho <hhstark.kang@samsung.com>
screen_connector_remote_surface/trs_internal.h

index caf4ace..593a3de 100644 (file)
@@ -54,6 +54,9 @@ class TRS : public Handle<struct tizen_remote_surface*>, public ITRS {
   }
 
   void TransferTouchCancel() override {
+    if (!is_down_)
+      return;
+    is_down_ = false;
     tizen_remote_surface_transfer_touch_cancel(GetRaw());
   }
 
@@ -108,6 +111,10 @@ class TRS : public Handle<struct tizen_remote_surface*>, public ITRS {
                           wl_fixed_t pressure, wl_fixed_t angle,
                           uint32_t clas, uint32_t subclas,
                           const char *identifier, uint32_t time) override {
+    if (event_type == TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_DOWN)
+      is_down_ = true;
+    else if (event_type == TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_UP)
+      is_down_ = false;
     tizen_remote_surface_transfer_mouse_event(GetRaw(), event_type,
         device, button, x, y, radius_x, radius_y, pressure, angle, clas,
         subclas, identifier, time);
@@ -151,6 +158,7 @@ class TRS : public Handle<struct tizen_remote_surface*>, public ITRS {
 
  private:
   ITRS::IEventListener* listener_ = nullptr;
+  bool is_down_ = false;
 };
 
 }  // namespace screen_connector