e_service_kvm: ungrab input before drag start 64/298064/3
authorJunseok Kim <juns.kim@samsung.com>
Thu, 31 Aug 2023 00:05:29 +0000 (09:05 +0900)
committerJunSeok Kim <juns.kim@samsung.com>
Fri, 1 Sep 2023 01:38:02 +0000 (01:38 +0000)
Change-Id: Ieb55196b70ba00a94eaea716338761eb72515283

src/bin/services/e_service_kvm.c

index e4cbbd9..ba2aaa0 100644 (file)
@@ -56,9 +56,23 @@ _kvm_hook_client_del(void *d EINA_UNUSED, E_Client *ec)
 static void
 _kvm_hook_drag_start(void *d EINA_UNUSED, E_Drag *drag)
 {
+   E_Comp_Wl_Data_Source *source;
+   struct wl_client *source_client, *kvm_client;
+
    if (!drag) return;
    if (!_kvm_service) return;
 
+   // Workaround: Feed mouse out/in to make sure that the mouse in to correct client.
+   // The evas event mouse in/out is not emit during dragging(mouse move with mouse button pressed).
+   // It makes the pointer still locked after mouse out from kvm window When the drag started.
+   source = e_comp_wl->drag_source;
+   source_client = wl_resource_get_client(source->resource);
+   kvm_client = wl_resource_get_client(_kvm_service->srv_kvm_res);
+   if (source_client == kvm_client)
+     {
+        e_comp_ungrab_input(1, 1);
+     }
+
    e_service_kvm_send_drag_start();
 }