screen_connector_toolkit_h toolkit_h;
int freeze;
bool is_init;
+ bool is_down;
Evas_Object *img_tbm;
Evas_Object *img_file;
uint32_t img_type;
static void __rs_cb_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void __obj_update_visibility(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void __cancel_touch(screen_connector_toolkit_evas_h h)
+{
+ struct tizen_remote_surface *surface;
+
+ if (!h->is_down)
+ return;
+
+ h->is_down = false;
+ surface = screen_connector_toolkit_get_trs(h->toolkit_h);
+ if (!surface) {
+ LOGE("failed to get tizen remote surface");
+ return;
+ }
+
+ tizen_remote_surface_transfer_touch_cancel(surface);
+}
+
static gint __comp_win_id(gconstpointer a, gconstpointer b)
{
viewer_visibility_h win = (viewer_visibility_h)a;
if (__delayed_resuming_time == 0 ||
toolkit_evas_h->screen_type == SCREEN_CONNECTOR_SCREEN_TYPE_WATCH) {
if (obscured == TIZEN_REMOTE_SURFACE_VISIBILITY_TYPE_INVISIBLE)
- tizen_remote_surface_transfer_touch_cancel(surface);
+ __cancel_touch(toolkit_evas_h);
- LOGI("normal resume");
+ LOGI("normal visibility %d", obscured);
tizen_remote_surface_transfer_visibility(surface, obscured);
return 0;
toolkit_evas_h->resuming_timer = 0;
}
- tizen_remote_surface_transfer_touch_cancel(surface);
+ __cancel_touch(toolkit_evas_h);
tizen_remote_surface_transfer_visibility(surface, obscured);
} else {
if (toolkit_evas_h->resuming_timer == 0) {
return;
}
+ toolkit_evas_h->is_down = true;
tizen_remote_surface_transfer_mouse_event(surface,
TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_DOWN,
0,
return;
}
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) {
+ LOGD("Event canceld");
+ __cancel_touch(toolkit_evas_h);
+ return;
+ }
+
/*
* We need to send move event for
* consistency with old widget framework
desc,
ev->timestamp);
+ toolkit_evas_h->is_down = false;
tizen_remote_surface_transfer_mouse_event(surface,
TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_UP,
0,
EXPORT_API int screen_connector_toolkit_evas_send_touch_cancel(Evas_Object *obj)
{
screen_connector_toolkit_evas_h toolkit_evas_h;
- struct tizen_remote_surface *surface;
toolkit_evas_h = __find_toolkit_evas_h(obj);
if (!toolkit_evas_h) {
}
if (toolkit_evas_h->img_tbm) {
- surface = screen_connector_toolkit_get_trs(toolkit_evas_h->toolkit_h);
- if (surface == NULL) {
- LOGE("surface is NULL");
- return -1;
- }
-
- tizen_remote_surface_transfer_touch_cancel(surface);
+ __cancel_touch(toolkit_evas_h);
} else {
- LOGE("surface not yet initialized.");
+ LOGE("Null tbm image.");
return -1;
}
}
h->bind_win_id = bind_win_id;
- trs = screen_connector_toolkit_get_trs(h->toolkit_h);
- if (trs) {
- tizen_remote_surface_transfer_touch_cancel(trs);
- } else {
- LOGE("failed to get tizen remote surface");
- return -1;
- }
-
+ __cancel_touch(h);
if (h->cur_buffer) {
+ trs = screen_connector_toolkit_get_trs(h->toolkit_h);
+ if (trs == NULL) {
+ LOGE("failed to get tizen remote surface");
+ return -1;
+ }
+
if (tizen_remote_surface_get_version(trs)
>= TIZEN_REMOTE_SURFACE_RELEASE_SINCE_VERSION) {
- c_buf_info = g_hash_table_lookup(
- __cur_buffer_table, h->cur_buffer);
+ c_buf_info = g_hash_table_lookup(__cur_buffer_table,
+ h->cur_buffer);
if (c_buf_info != NULL)
__cur_buffer_info_unref(trs, c_buf_info);
}
return ret;
}
- trs = screen_connector_toolkit_get_trs(toolkit_evas_h->toolkit_h);
- if (trs) {
- tizen_remote_surface_transfer_touch_cancel(trs);
- } else {
- LOGE("failed to get tizen remote surface");
- return -1;
- }
-
+ __cancel_touch(toolkit_evas_h);
toolkit_evas_h->blocked = true;
if (toolkit_evas_h->cur_buffer) {
+ trs = screen_connector_toolkit_get_trs(toolkit_evas_h->toolkit_h);
+ if (trs == NULL) {
+ LOGE("failed to get tizen remote surface");
+ return -1;
+ }
+
if (tizen_remote_surface_get_version(trs)
>= TIZEN_REMOTE_SURFACE_RELEASE_SINCE_VERSION) {
- c_buf_info = g_hash_table_lookup(
- __cur_buffer_table,
+ c_buf_info = g_hash_table_lookup(__cur_buffer_table,
toolkit_evas_h->cur_buffer);
if (c_buf_info != NULL)
__cur_buffer_info_unref(trs, c_buf_info);