Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4861,9 +4861,9 @@ void flushQueueOnDnd() {
// to determine DnD threshold.
// This is to preserve backwards Cocoa/Win32 compatibility.
Event mouseDownEvent = dragDetectionQueue.getFirst();
mouseDownEvent.data = Boolean.valueOf(true); // force send MouseDown to avoid subsequent MouseMove before MouseDown.
mouseDownEvent.data = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting data to null is not needed too. Please remove it, it might have the positive side effect of not losing any other data that could have been there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is taken from sendOrPost.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, formerly it was setting true into data so that this method would do a send and this method does also set data to null:

private boolean sendOrPost(int type, Event event) {
assert event.data != null : "event.data should have been a Boolean, but received null";
boolean send = (Boolean) event.data;
event.data = null;
if (send) {
sendEvent (type, event);
if (isDisposed ()) return false;
} else {
postEvent (type, event);
}
return event.doit;
}

But I don't think there is a compelling reason to set data to null to maybe replace some other value. If there is another value in data (in the future), replacing it with null is like to be unhelpful.

dragDetectionQueue = null;
sendOrPost(SWT.MouseDown, mouseDownEvent);
sendEvent(SWT.MouseDown, mouseDownEvent);
}

boolean sendDragEvent (int button, int stateMask, int x, int y, boolean isStateMask) {
Expand Down
Loading