From: duna.oh Date: Fri, 14 Jun 2024 07:21:36 +0000 (+0900) Subject: e_dnd: ungrab input without feeding mouse out/in when pointer is constrainted X-Git-Tag: accepted/tizen/8.0/unified/20240705.163555~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc23e711cbbc3df6fd7b1dab169028b1fd5d64ae;p=platform%2Fupstream%2Fenlightenment.git e_dnd: ungrab input without feeding mouse out/in when pointer is constrainted If drag is cancelled by KVM service and pointer is already constrainted (locked in Edge window), additional mouse out/in event onto the Edge results in being unlocked and locked again. Drag and drop sequence goes as follows: 1. Drag starts with a touch down event on Evas 1. 2. Dragging onto Evas 2 involves several steps: Mouse OUT event on Evas 1 (Browser). Mouse IN event on Evas 2 (Edge). --> locked Mouse move event on Evas 2. 3. The drag ends with a touch up event on Evas 2: Mouse OUT event on Evas 2. --> unlocked --> issue Mouse IN event on Evas 2. --> locked --> issue Change-Id: Ib5550ef087358a0e262fc59d97b0b7214d784870 --- diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index 1a70124575..35159fb74c 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -1550,3 +1550,33 @@ e_comp_focused_ec_get(void) return NULL; } + +EINTERN void +e_comp_ungrab_input_without_inout(Eina_Bool mouse, Eina_Bool kbd) +{ + Ecore_Window mwin = 0, kwin = 0; + + mouse = !!mouse; + kbd = !!kbd; + if (e_comp->input_mouse_grabs) + e_comp->input_mouse_grabs -= mouse; + + if (e_comp->input_key_grabs) + e_comp->input_key_grabs -= kbd; + + if (mouse && (!e_comp->input_mouse_grabs)) + mwin = e_comp->ee_win; + + if (kbd && (!e_comp->input_key_grabs)) + kwin = e_comp->ee_win; + + //e_comp_override_timed_pop(); //nocomp condition + if ((!mwin) && (!kwin)) return; + e_grabinput_release(mwin, kwin); + if (e_client_focused_get()) return; + + E_Zone *zone = e_zone_current_get(); + if (!zone) return; + + e_zone_focus_reset(zone); +} diff --git a/src/bin/e_comp.h b/src/bin/e_comp.h index ee78165188..ece78c0370 100644 --- a/src/bin/e_comp.h +++ b/src/bin/e_comp.h @@ -272,6 +272,7 @@ EINTERN void e_comp_idler_before(void); EINTERN void e_comp_visibility_calculation_set(Eina_Bool set); EINTERN Eina_Bool e_comp_visibility_calculation_get(void); EINTERN E_Client *e_comp_focused_ec_get(void); +EINTERN void e_comp_ungrab_input_without_inout(Eina_Bool mouse, Eina_Bool kbd); #endif #endif diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c index 5c8733e0ff..0f1b11209c 100644 --- a/src/bin/e_dnd.c +++ b/src/bin/e_dnd.c @@ -277,7 +277,16 @@ _e_drag_end(E_Drag *drag, E_Dnd_Drop_Type type) if (drag->input_grab) { - e_comp_ungrab_input(1, 1); + if ((type == E_DND_DRAG_TYPE_CANCELLED_BY_KVM) && + (e_comp_wl_input_pointer_constraint_activated_get())) + { + ELOGF("DnD", "Pointer Constraint activated. call e_comp_ungrab_input_without_inout", NULL); + e_comp_ungrab_input_without_inout(1, 1); + } + else + { + e_comp_ungrab_input(1, 1); + } drag->input_grab = EINA_FALSE; } diff --git a/src/bin/e_dnd.h b/src/bin/e_dnd.h index 1efe1bd4f9..6065780b24 100644 --- a/src/bin/e_dnd.h +++ b/src/bin/e_dnd.h @@ -20,6 +20,7 @@ typedef enum _E_Dnd_Drop_Type { E_DND_DRAG_TYPE_DROPPED, E_DND_DRAG_TYPE_CANCELLED, + E_DND_DRAG_TYPE_CANCELLED_BY_KVM, } E_Dnd_Drop_Type; typedef void (*E_Drag_Hook_Cb)(void *data, E_Drag *drag); diff --git a/src/bin/services/e_service_kvm.c b/src/bin/services/e_service_kvm.c index 7bbb89d920..ed244d96f3 100644 --- a/src/bin/services/e_service_kvm.c +++ b/src/bin/services/e_service_kvm.c @@ -266,7 +266,7 @@ e_service_kvm_drag_cancel(E_Client *ec) ELOGF("KVM", "Cancel drag by kvm_service request! service:%p", ec, esk); - e_drag_end(e_comp_wl->drag, E_DND_DRAG_TYPE_CANCELLED); + e_drag_end(e_comp_wl->drag, E_DND_DRAG_TYPE_CANCELLED_BY_KVM); return EINA_TRUE; }