Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8262446: DragAndDrop hangs on Windows #2825

Closed
wants to merge 4 commits into from

Conversation

@dmarkov20
Copy link
Member

@dmarkov20 dmarkov20 commented Mar 4, 2021

The IME functions and the DND operation must be executed on the toolkit thread. If the DND operation is in progress, the IME API is invoked via SendMessage() call inside InvokeInputMethodFunction() to avoid a hang. The flag isInDoDragDropLoop indicates whether the DND takes place or not. The flag works properly if the DND is performed between two Java windows. However if anything is dragged from native app, (e.g. Windows FileExplorer) to Java the flag is NOT set. That’s the root cause of the hang.

Fix:
Introduce a new flag to indicate DND operation between Java and native app.

Testing:
mach5 green


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2825/head:pull/2825
$ git checkout pull/2825

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Mar 4, 2021

👋 Welcome back dmarkov! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Mar 4, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 4, 2021

@dmarkov20 The following labels will be automatically applied to this pull request:

  • 2d
  • awt

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added 2d awt labels Mar 4, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Mar 4, 2021

@openjdk
Copy link

@openjdk openjdk bot commented Mar 4, 2021

@dmarkov20 This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8262446: DragAndDrop hangs on Windows

Reviewed-by: aivanov, serb, kizune

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 31 new commits pushed to the master branch:

  • 5eb2091: 8261689: javax/swing/JComponent/7154030/bug7154030.java still fails with "Exception: Failed to hide opaque button"
  • 75a5be8: 8263054: [testbug] SharedArchiveConsistency.java reuses jsa files
  • 2afbd5d: 8250804: Can't set the application icon image for Unity WM on Linux.
  • fa43f92: 8261845: File permissions of packages built by jpackage
  • 23ee60d: 8261008: Optimize Xor
  • e1cad97: 8262862: Harden tests sun/security/x509/URICertStore/ExtensionsWithLDAP.java and krb5/canonicalize/Test.java
  • 2c0507e: 8261812: C2 compilation fails with assert(!had_error) failed: bad dominance
  • 9755782: 8157682: @inheritdoc doesn't work with @exception
  • 8c13d26: 8263050: move HtmlDocletWriter.verticalSeparator to IndexWriter
  • 8d3de4b: 8262844: (fs) FileStore.supportsFileAttributeView might return false negative in case of ext3
  • ... and 21 more: https://git.openjdk.java.net/jdk/compare/22513199e5107692ab52f89e9646e468abc34353...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Mar 4, 2021
@mrserb
Copy link
Member

@mrserb mrserb commented Mar 5, 2021

Why we cannot reuse the old flag? "isInDoDragDropLoop"? I think the Robot.waitForIdle() will hang if isInDoDragDropLoop is not set to true while dragging something from the native app.

@takiguc
Copy link

@takiguc takiguc commented Mar 5, 2021

@dmarkov20
I'd like to confirm this issue was not fixed by JDK-8261231 #2448 ?

@dmarkov20
Copy link
Member Author

@dmarkov20 dmarkov20 commented Mar 5, 2021

Why we cannot reuse the old flag? "isInDoDragDropLoop"? I think the Robot.waitForIdle() will hang if isInDoDragDropLoop is not set to true while dragging something from the native app.

Initially I didn’t want to touch that flag but after a closer look to “isInDoDragDropLoop” I think it is OK to reuse the flag. I will update PR shortly.

@dmarkov20
Copy link
Member Author

@dmarkov20 dmarkov20 commented Mar 5, 2021

@dmarkov20
I'd like to confirm this issue was not fixed by JDK-8261231 #2448 ?

That's right. This one and JDK-8261231 are two different issues. It is expected that the changes for JDK-8261231 do not fix this.

@dmarkov20
Copy link
Member Author

@dmarkov20 dmarkov20 commented Mar 5, 2021

I have update the fix: reuse isInDoDragDropLoop flag instead of introducing a new one.
@mrserb @aivanov-jdk
Could you take a look, please?

mrserb
mrserb approved these changes Mar 5, 2021
@takiguc
Copy link

@takiguc takiguc commented Mar 6, 2021

@dmarkov20
Sorry I'm not reviewer.
It seems Copyright year is not changed. Is it OK ?

@dmarkov20
Copy link
Member Author

@dmarkov20 dmarkov20 commented Mar 6, 2021

@dmarkov20
Sorry I'm not reviewer.
It seems Copyright year is not changed. Is it OK ?

I have updated the copyright

@dmarkov20
Copy link
Member Author

@dmarkov20 dmarkov20 commented Mar 8, 2021

/integrate

@openjdk openjdk bot closed this Mar 8, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Mar 8, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 8, 2021

@dmarkov20 Since your change was applied there have been 44 commits pushed to the master branch:

  • b1cc864: 8251210: Link JDK api docs to other versions
  • 0da889e: 8210100: ParallelGC should use parallel WeakProcessor
  • 679faa6: 8263097: Update JMH devkit to 1.28
  • ab2cfcc: 8252831: Correct "no comment" warnings in jdk.net module
  • 51cca57: 8259577: Dangling reference to temp_path in Java_sun_tools_attach_VirtualMachineImpl_getTempDir
  • a0c3f24: 8263091: Remove CharacterData.isOtherUppercase/-Lowercase
  • 13625be: 8263090: Avoid reading volatile fields twice in Locale.getDefault(Category)
  • 61cff4d: 8257913: Add more known library locations to simplify Linux cross-compilation
  • 22a3117: 8263137: Typos in sun.security.ssl.RenegoInfoExtension
  • 18fc350: 8259886: Improve SSL session cache performance and scalability
  • ... and 34 more: https://git.openjdk.java.net/jdk/compare/22513199e5107692ab52f89e9646e468abc34353...master

Your commit was automatically rebased without conflicts.

Pushed as commit bf9b74d.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@dmarkov20 dmarkov20 deleted the JDK-8262446-fix branch Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants