#include "e_view_client_intern.h"
#include "e_view_edje_intern.h"
#include "e_view_rect.h"
+#include "e_input.h"
+#include "services/e_service_kvm_intern.h"
struct _E_Drag_Hook
{
static Ecore_Window _drag_win = 0;
static E_Drag *_drag_current = NULL;
+static Eina_Bool _mouse_down_sent = EINA_FALSE;
static int _e_drag_hooks_delete = 0;
if (drag->input_grab)
{
- if ((type == E_DND_DRAG_TYPE_CANCELLED_BY_KVM) &&
- (e_comp_wl_input_pointer_constraint_activated_get()))
+ if (type == E_DND_DRAG_TYPE_CANCELLED_BY_KVM)
{
- ELOGF("DnD", "Pointer Constraint activated. call e_comp_ungrab_input_without_inout", NULL);
- e_comp_ungrab_input_without_inout(1, 1);
+ if (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);
+ }
+ if (e_devicemgr && e_devicemgr->last_device_ptr)
+ {
+ if (e_input_device_is_virtual(NULL, e_devicemgr->last_device_ptr->identifier, ECORE_DEVICE_CLASS_MOUSE))
+ {
+ ELOGF("DnD", "Cancelled by KVM. using virtual device", NULL);
+ }
+ else if (e_service_kvm_service_get(e_comp_wl->ptr.ec))
+ {
+ ELOGF("DnD", "Cancelled by KVM. send mouse button DOWN event to KVM", NULL);
+ e_comp_wl_mouse_button_send(e_comp_wl->ptr.ec, 1, 1, NULL, 0);
+ _mouse_down_sent = EINA_TRUE;
+ }
+ }
}
else
{
Ecore_Event_Mouse_Button *ev = event;
int device_id = e_comp_wl_data_current_device_id_get();
+ if (_mouse_down_sent)
+ {
+ if (e_service_kvm_service_get(e_comp_wl->ptr.ec))
+ {
+ ELOGF("DnD", "Mouse Up. send mouse button UP event to KVM", NULL);
+ e_comp_wl_mouse_button_send(e_comp_wl->ptr.ec, 1, 0, NULL, 0);
+ }
+ _mouse_down_sent = EINA_FALSE;
+ }
+
if (!_drag_current) return ECORE_CALLBACK_PASS_ON;
if (ev->window != _drag_win) return ECORE_CALLBACK_PASS_ON;
if ((device_id >= 0) &&