Skip to content

Conversation

tmssngr
Copy link
Contributor

@tmssngr tmssngr commented Oct 1, 2025

Inlined sendOrPost for this special case making it more obvious that an (immediate) sendEvent is happening.

Copy link
Contributor

github-actions bot commented Oct 1, 2025

Test Results

  118 files  ±0    118 suites  ±0   12m 50s ⏱️ + 1m 43s
4 583 tests ±0  4 547 ✅ ±0  36 💤 ±0  0 ❌ ±0 
  330 runs  ±0    307 ✅ ±0  23 💤 ±0  0 ❌ ±0 

Results for commit 762462d. ± Comparison against base commit 48e5878.

// 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants