#endif
#define EC_IS_NOT_VISIBLE if (ec->visibility.obscured != E_VISIBILITY_UNOBSCURED)
+static Eina_Bool
+_e_client_visibility_touched_check(E_Client *ec)
+{
+ Eina_Bool res = EINA_FALSE;
+ int x, y, w, h;
+ int tx, ty;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec, res);
+
+ tx = wl_fixed_to_int(e_comp->wl_comp_data->ptr.x);
+ ty = wl_fixed_to_int(e_comp->wl_comp_data->ptr.y);
+
+ e_client_geometry_get(ec, &x, &y, &w, &h);
+
+ if ((tx >= x) && (tx <= x + w) &&
+ (ty >= y) && (ty <= y + h))
+ {
+ res = EINA_TRUE;
+ }
+
+ return res;
+}
+
static void
_e_client_visibility_zone_calculate(E_Zone *zone, Eina_Bool check_focus)
{
Eina_Bool ec_frame_visible = EINA_FALSE;
int calc_skip_type = 0;
+ Eina_Bool touched_win_changed = EINA_FALSE;
+ E_Client *touched_ec;
+
if (!e_config->calc_vis_without_effect)
{
if (e_comp->animating) return;
if (changed_list)
{
+ touched_ec = e_comp_wl->ptr.ec ? e_comp_wl->ptr.ec : e_comp_wl->touch.faked_ec;
EINA_LIST_FOREACH(changed_list, l, ec)
{
if (ec->visibility.changed)
_e_client_hook_call(E_CLIENT_HOOK_EVAL_VISIBILITY, ec);
+ if (ec == touched_ec)
+ touched_win_changed = EINA_TRUE;
+
if (ec->visibility.obscured == E_VISIBILITY_UNOBSCURED)
{
+ if (e_comp_wl->touch.pressed && !touched_win_changed && !e_policy_client_is_keyboard_sub(ec))
+ {
+ if (_e_client_visibility_touched_check(ec))
+ {
+ touched_win_changed = EINA_TRUE;
+ e_comp_wl_touch_cancel();
+ }
+ }
if (!find_top_vis_ec)
{
find_top_vis_ec = EINA_TRUE;
static void
_e_comp_wl_touch_cancel(void)
{
- if (!e_comp_wl->ptr.ec)
- return;
+ E_Client *ec;
+
+ ec = e_comp_wl->ptr.ec ? e_comp_wl->ptr.ec : e_comp_wl->touch.faked_ec;
+ if (!ec) return;
if (!need_send_released)
return;
- _e_comp_wl_send_touch_cancel(e_comp_wl->ptr.ec);
+ _e_comp_wl_send_touch_cancel(ec);
need_send_released = EINA_FALSE;
need_send_motion = EINA_FALSE;
if (e_object_is_del(E_OBJECT(ec))) return;
if (ec->comp_data->sub.restacking) return;
- if (ec->visibility.obscured == E_VISIBILITY_FULLY_OBSCURED)
- _e_comp_wl_touch_cancel();
-
e_comp_wl_subsurface_stack_update(ec);
}
if (dev && (evas_device_class_get(dev) == EVAS_DEVICE_CLASS_TOUCH))
{
+ if (!e_comp_wl->touch.pressed)
+ e_comp_wl->touch.faked_ec = ec;
+
if (dev_name)
_e_comp_wl_device_renew_axis(dev_name, evas_device_class_get(dev),
ec, 0, ev->radius_x, ev->radius_y, ev->pressure, ev->angle);
if (dev && (evas_device_class_get(dev) == EVAS_DEVICE_CLASS_TOUCH))
{
+ e_comp_wl->touch.pressed &= ~(1 << 0);
+
+ if (!e_comp_wl->touch.pressed && e_comp_wl->touch.faked_ec)
+ e_comp_wl->touch.faked_ec = NULL;
+
if (dev_name)
_e_comp_wl_device_handle_axes(dev_name, evas_device_class_get(dev),
ec, 0, ev->radius_x, ev->radius_y, ev->pressure, ev->angle);
_e_comp_wl_evas_handle_mouse_button_to_touch(ec, ev->timestamp, ev->canvas.x, ev->canvas.y, EINA_FALSE);
- e_comp_wl->touch.pressed &= ~(1 << 0);
}
else
e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button,
flags = evas_event_default_flags_get(evas);
if (flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+ e_comp_wl->touch.pressed &= ~(1 << ev->device);
+ if (!e_comp_wl->touch.pressed && e_comp_wl->touch.faked_ec)
+ e_comp_wl->touch.faked_ec = NULL;
+
dev = ev->dev;
if (dev && (dev_name = evas_device_description_get(dev)))
{
}
_e_comp_wl_send_touch(ec, ev->device, 0, 0, ev->timestamp, EINA_FALSE);
- e_comp_wl->touch.pressed &= ~(1 << ev->device);
}
static void