e_dnd: drag end when mouse up without motion
authorJunseok Kim <juns.kim@samsung.com>
Thu, 22 Jun 2023 05:40:06 +0000 (14:40 +0900)
committerJunseok Kim <juns.kim@samsung.com>
Thu, 29 Jun 2023 02:29:04 +0000 (11:29 +0900)
There was a bug that drag didn't end when mouse just click without any
motion.
It caused by the device id assign when the pointer moves.
For fix the issue, end drag that the device_id didn't assigned on
mouse_up callback.

Change-Id: I2e52915a006de65fe16de36e466a466e70dd7410

src/bin/e_dnd.c

index 755cee5..93b275d 100644 (file)
@@ -633,7 +633,9 @@ _e_dnd_cb_mouse_up(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
    int device_id = e_comp_wl_data_current_device_id_get();
 
    if (ev->window != _drag_win) return ECORE_CALLBACK_PASS_ON;
-   if (ev->multi.device != device_id) return ECORE_CALLBACK_PASS_ON;
+   if ((device_id >= 0) &&
+       (ev->multi.device != device_id))
+     return ECORE_CALLBACK_PASS_ON;
 
    if (_drag_current && _drag_current->button_mask)
      {