[nautilus/wip/coreyberla/dnd-threshold] list-base: Prevent accidental hover-switch on slightest movement
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/coreyberla/dnd-threshold] list-base: Prevent accidental hover-switch on slightest movement
- Date: Wed, 10 Aug 2022 09:58:21 +0000 (UTC)
commit d06fc2251cf4c7d76ddafde8030072bed43c5ad7
Author: António Fernandes <antoniof gnome org>
Date: Wed Aug 10 10:51:02 2022 +0100
list-base: Prevent accidental hover-switch on slightest movement
When switching to a new folder by hovering it during DND, there is a
chance that a subfolder is going to appear right under the pointer.
Since the pointer is likely still moving (because it's tied to human
hand movement), the timeout for entering the subfolder starts right
away, resulting in an accidental location switch.
To prevent this, in the ::enter signal store the start coordinates
without starting the timeout. The ::motion handler is then going to
start the timeout only after significant pointer movement.
This has the side effect of also making it harder to accidentally
enter a folder by hovering only the edge of it, assuming that when
a person intends to open the folder on hover they are going to target
the center of the cell.
src/nautilus-list-base.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c
index c48712682..261eae1f5 100644
--- a/src/nautilus-list-base.c
+++ b/src/nautilus-list-base.c
@@ -571,10 +571,8 @@ on_item_drag_hover_enter (GtkDropControllerMotion *controller,
NautilusListBase *self = nautilus_view_cell_get_view (cell);
NautilusListBasePrivate *priv = nautilus_list_base_get_instance_private (self);
- if (priv->hover_timer_id == 0)
- {
- priv->hover_timer_id = g_timeout_add (HOVER_TIMEOUT, hover_timer, cell);
- }
+ priv->drag_x = x;
+ priv->drag_y = y;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]