Closed
Bug 358095
Opened 19 years ago
Closed 15 years ago
use the copy cursor for copy drags in cocoa drag and drop
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a3
People
(Reporter: jaas, Assigned: mstange)
References
Details
Attachments
(1 file, 1 obsolete file)
|
8.00 KB,
patch
|
jaas
:
review+
|
Details | Diff | Splinter Review |
We should use the copy cursor for copy drags in cocoa drag and drop. Right now everything is just a generic drag.
This should fix this in theory, but in practice gecko makes bad drag action choices so we end up using generic dragging all the time anyway.
For example - when you drag some text in the browser to a text box, you'd think gecko would consider it a copy but it actually considers it to be a move. That doesn't really make sense because you're not moving the text, you're copying it to the text field (obviously).
fwiw, this bug has existed in mozilla forever. We never used native drag cursors. Camino did in its own code, but it just always said the drag was a copy instead of trying to figure out what it actually was.
Blocks: 332913
Comment 2•17 years ago
|
||
| Assignee | ||
Comment 5•15 years ago
|
||
Neil, what's the right way to predict from cocoa code whether a drag will be a copy?
Comment 6•15 years ago
|
||
Since I'm not sure what event you're referring to, here is the way the effects are expected to work:
Before dragstart:
effectAllowed is initialized to 'uninitialized'
dropEffect is initialized to 'none'
After dragstart:
effectAllowed, if set, is the effects that the source of the drag allows. If effectAllowed is 'uninitialized', this is equivalent to 'all'.
dropEffect isn't currently used by drag service implementations, but could be used to specify the source's preferred effect. (I think this is the question that you are asking?)
After dragstart, one of the InvokeDragSession methods will be called. InvokeDragSessionWithImage and InvokeDragSessionWithSelection take a dataTransfer, although it may be null. The action supplied to these methods is equivalent to the effectAllowed, and is just a shorthand.
Before the drag and dragleave events:
dragSession.dragAction isn't used, but the drag service should set the current desired state for older code
effectAllowed is initialized from the value it had after the dragstart event
dropEffect is set to whatever value it had last
After the drag and dragleave events:
effectAllowed's value isn't used for anything
dropEffect's value isn't used for anything
dragSession.dragAction is unchanged
Before the dragenter and dragover events:
dragSession.dragAction should be set by the drag service implementation to the desired drop effect, based on the keyboard state
effectAllowed is initialized from the value it had after the dragstart event
dropEffect is initialized from dragSession.dragAction, filtered based on effectAllowed
After the dragenter and dragover events:
effectAllowed will specify the drop effects that the drop target allows
dropEffect will specify the drop target's preferred drop effect
dragSession.dragAction will be set to the dropEffect, filtered by the effectAllowed.
The drag service can use the effectAllowed and dragSession.dragAction to update the cursor, or can update it before the event based on the key state.
Before the drop and dragend events:
effectAllowed is initialized from the value it had after the dragstart event
dropEffect will specify the actual drop effect, set from the value it had after the last dragenter or dragover event
dragSession.dragAction isn't used, but the drag service should set the actual drop effect for older code
Some bugs in the drag event handling code:
- when a drag from an another application occurs, the effectAllowed isn't initialized properly.
- nsContentAreaDragDrop::GetDragData could set the effectAllowed or dropEffect for the 'built-in' drags.
| Assignee | ||
Comment 7•15 years ago
|
||
I didn't really know how drag and drop works, so I wasn't sure myself what I was asking, but this summary is perfect and clears things up for me quite a bit. Thanks!
| Assignee | ||
Comment 8•15 years ago
|
||
Assignee: nobody → mstange
Attachment #244308 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #430426 -
Flags: review?(joshmoz)
Attachment #430426 -
Flags: review?(joshmoz) → review+
| Assignee | ||
Comment 9•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Hardware: PowerPC → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a3
You need to log in
before you can comment on or make changes to this bug.
Description
•