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

8256373: [Windows/HiDPI] The Frame#setBounds does not work in a minimized state #1216

Closed
wants to merge 1 commit into from

Conversation

@mrserb
Copy link
Member

@mrserb mrserb commented Nov 16, 2020

On HIDPI Windows, the Frame#setBounds does not work in a minimized state. The bug found during the development of JDK-8211999. When the frame is iconized and we try to save new bounds for future use, we store the coordinates in the user's space to the field which use device space:
https://github.com/openjdk/jdk/blob/master/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp#L664


Progress

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

Testing

Linux aarch64 Linux arm Linux ppc64le Linux s390x Linux x64 Linux x86 Windows x64 macOS x64
Build ✔️ (1/1 passed) ✔️ (1/1 passed) ✔️ (1/1 passed) ✔️ (1/1 passed) ✔️ (5/5 passed) ✔️ (2/2 passed) ✔️ (2/2 passed) ✔️ (2/2 passed)
Test (tier1) ✔️ (9/9 passed) ✔️ (9/9 passed) ✔️ (9/9 passed) ✔️ (9/9 passed)

Issue

  • JDK-8256373: [Windows/HiDPI] The Frame#setBounds does not work in a minimized state

Reviewers

Download

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 16, 2020

👋 Welcome back serb! 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
Copy link

@openjdk openjdk bot commented Nov 16, 2020

@mrserb 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.

@mrserb
Copy link
Member Author

@mrserb mrserb commented Nov 16, 2020

/label remove 2d

@openjdk openjdk bot removed the 2d label Nov 16, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Nov 16, 2020

@mrserb
The 2d label was successfully removed.

@mrserb mrserb marked this pull request as ready for review Nov 16, 2020
@openjdk openjdk bot added the rfr label Nov 16, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 16, 2020

Webrevs

@azuev-java
Copy link
Member

@azuev-java azuev-java commented Nov 18, 2020

Quick question: is there any way to manually reproduce this problem or it is only possible programmatically? How can you move iconified window to another display without de-iconifying it?

@mrserb
Copy link
Member Author

@mrserb mrserb commented Nov 18, 2020

Quick question: is there any way to manually reproduce this problem or it is only possible programmatically? How can you move iconified window to another display without de-iconifying it?

To reproduce the bug it is necessary to call setBounds method while the window is iconified - actually replacing its normal state bounds. So when the frame will de-iconifying(become normal) it appeared on the new bounds.

@mrserb
Copy link
Member Author

@mrserb mrserb commented Nov 30, 2020

Any volunteers for a review?

@azuev-java
Copy link
Member

@azuev-java azuev-java commented Nov 30, 2020

Ok, i played around with the fix, seems to be working fine.

@openjdk
Copy link

@openjdk openjdk bot commented Nov 30, 2020

@mrserb 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:

8256373: [Windows/HiDPI] The Frame#setBounds does not work in a minimized state

Reviewed-by: kizune, aivanov

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 260 new commits pushed to the master branch:

  • 29f86e0: 8256536: Newer AMD 19h (EPYC) Processor family defaults
  • 7f58a8e: 8213719: Both sect163r2 and sect163k1 are default curves for field size 163
  • ae5b526: 8257448: Clean duplicated non-null check in the SunJSSE provider implementation
  • 41dbc13: 8180352: Add Stream.toList() method
  • 8969069: 8256995: [vector] Improve broadcast operations
  • 6eb25d7: 8254082: AbstractStringBuilder.insert(int dstOffset, CharSequence s, int start, int end) is missing fast-path for String
  • 4c86e46: 8256810: Incremental rebuild broken on Macosx
  • 02ba519: 8255001: Move G1PeriodicGCTask to its own file
  • 8aaee53: 8256187: [TEST_BUG] Automate bug4275046.java test
  • a3e1980: 8256541: Sort out what version of awk is used in the build system
  • ... and 250 more: https://git.openjdk.java.net/jdk/compare/1e9a432d59fa3fb3d038c83c88fd7eeb3052960c...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 Nov 30, 2020
@mrserb
Copy link
Member Author

@mrserb mrserb commented Dec 1, 2020

/integrate

@openjdk openjdk bot closed this Dec 1, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Dec 1, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Dec 1, 2020

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

  • 0eaf0bb: 8257420: Zero VM build broken with clang after JDK-8256726 due to strlen() is not a constexpr
  • 822ee47: 8257242: [macOS] Java app crashes while switching input methods
  • 7d89852: 8244154: Update SunPKCS11 provider with PKCS11 v3.0 header files
  • 4356469: 8230501: Class data support for hidden classes
  • 11dad14: 8257445: (zipfs) Add DataProvider to TestLocOffsetFromZip64EF.java
  • 29f86e0: 8256536: Newer AMD 19h (EPYC) Processor family defaults
  • 7f58a8e: 8213719: Both sect163r2 and sect163k1 are default curves for field size 163
  • ae5b526: 8257448: Clean duplicated non-null check in the SunJSSE provider implementation
  • 41dbc13: 8180352: Add Stream.toList() method
  • 8969069: 8256995: [vector] Improve broadcast operations
  • ... and 255 more: https://git.openjdk.java.net/jdk/compare/1e9a432d59fa3fb3d038c83c88fd7eeb3052960c...master

Your commit was automatically rebased without conflicts.

Pushed as commit b5ce8af.

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

@mrserb mrserb deleted the JDK-8256373 branch Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants