Drag initiation should use system drag thresholds where available

RESOLVED FIXED

Status

()

RESOLVED FIXED
16 years ago
16 years ago

People

(Reporter: saari, Assigned: bryner)

Tracking

({topembed+})

Trunk
topembed+
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: edt_b3)

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
On Win32 we should use the drag threshold rect that the system is using.
Available via getsystemmetrics SM_CXDRAG and SM_CYDRAG

Do Mac and Linux have similar settings we can query?

Comment 1

16 years ago
Discussed in edt.  Plussing.
Keywords: topembed → topembed+
Whiteboard: edt_b3

Updated

16 years ago
Summary: Drag initiation should use system draq thresholds where available → Drag initiation should use system drag thresholds where available
mac has no similar setting, iirc.
(Assignee)

Comment 3

16 years ago
I can't find an API for this on Mac either.  By inspection, as you're dragging
the mouse (on a Finder icon), the item deselects after you move 4 pixels; the
item starts to move on the 5th pixel.

On linux, the threshold is hardcoded in gtk+ (1.x, anyway) to start the drag if
you've moved more than 3 pixels in any direction (gtk+ 1.2.10, gtkdnd.c, line
2433).  blizzard, is there something better we can do for gtk2?
(Assignee)

Comment 4

16 years ago
Ah, indeed there is.  We can do something like:

  gint drag_threshold;
  g_object_get (gtk_widget_get_settings (widget),
                "gtk-dnd-drag-threshold", &drag_threshold,
                NULL);    

on gtk2.
(Assignee)

Comment 5

16 years ago
Created attachment 122233 [details] [diff] [review]
patch

Use system setting for drag threshold on Win32 and gtk2; hardcode observed
threshold for Mac and gtk1.
(Assignee)

Updated

16 years ago
Attachment #122233 - Flags: superreview?(sfraser)
Attachment #122233 - Flags: review?(blizzard)

Updated

16 years ago
Attachment #122233 - Flags: superreview?(sfraser) → superreview+
Comment on attachment 122233 [details] [diff] [review]
patch


>+            gint threshold;
>+            g_object_get(gtk_widget_get_settings(box),
>+                         "gtk-dnd-drag-threshold", &threshold,
>+                         NULL);

Initialize threshold to zero in case that object_get() fails?  Other than that,
r=blizzard.
Attachment #122233 - Flags: review?(blizzard) → review+
(Assignee)

Comment 7

16 years ago
Comment on attachment 122233 [details] [diff] [review]
patch

Can we get this in for 1.4b? It's a pretty low-risk fix that makes our behavior
more platform-native.
Attachment #122233 - Flags: approval1.4b?
Comment on attachment 122233 [details] [diff] [review]
patch

a=sspitzer

I know that nsEventStateManager.cpp just loves to regress, but if bryner thinks
it is low risk, that's enough for me.
Attachment #122233 - Flags: approval1.4b? → approval1.4b+
(Assignee)

Comment 9

16 years ago
checked in.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.