Closed Bug 201342 Opened 22 years ago Closed 22 years ago

Drag initiation should use system drag thresholds where available

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: saari, Assigned: bryner)

Details

(Keywords: topembed+, Whiteboard: edt_b3)

Attachments

(1 file)

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?
Discussed in edt. Plussing.
Keywords: topembedtopembed+
Whiteboard: edt_b3
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.
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?
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.
Attached patch patchSplinter Review
Use system setting for drag threshold on Win32 and gtk2; hardcode observed threshold for Mac and gtk1.
Attachment #122233 - Flags: superreview?(sfraser)
Attachment #122233 - Flags: review?(blizzard)
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+
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+
checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: