Skip to content

8261840: Submenus close to screen borders are no longer repositioned #410

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

Closed
wants to merge 1 commit into from

Conversation

effad
Copy link

@effad effad commented Feb 23, 2021

Reverting to the old way of showing the context menu but with application
of CSS prior to calling prefHeight(-1) / prefWidth(-1) to ensure correct
size measurement of the menu.


Progress

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

Issue

  • JDK-8261840: Submenus close to screen borders are no longer repositioned

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jfx pull/410/head:pull/410
$ git checkout pull/410

Update a local copy of the PR:
$ git checkout pull/410
$ git pull https://git.openjdk.java.net/jfx pull/410/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 410

View PR using the GUI difftool:
$ git pr show -t 410

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jfx/pull/410.diff

Reverting to the old way of showing the context menu but with application
of CSS prior to calling prefHeight(-1) / prefWidth(-1) to ensure correct
size measurement of the menu.
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 23, 2021

👋 Welcome back rlichten! 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 Ready for review label Feb 23, 2021
@mlbridge
Copy link

mlbridge bot commented Feb 23, 2021

Webrevs

@kevinrushforth
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Feb 23, 2021

@kevinrushforth
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

@kevinrushforth
Copy link
Member

This fixes the bug in question, although I see a slight regression in behavior on Windows with 125% pixel scaling (it doesn't reproduce with any other scaling value that I tried). With the original test case for JDK-8228363, and TOP as the value of side, the initial menu is positioned slightly lower (by a few pixels) than it should be. See the attached image. It is correct the second and subsequent times the context menu is opened.

Given that this new bug only happens with 125% scaling, it seems likely that it is a preexisting bug, and this fix merely exposes it. Can you take a look at this? If it is preexisting, then we should file a follow-on bug for this.

ContextMenu-125

@effad
Copy link
Author

effad commented Mar 15, 2021 via email

@kevinrushforth
Copy link
Member

@effad have you had a chance to look at the rendering issues with 125% HiDPI scaling?

@effad
Copy link
Author

effad commented Apr 19, 2021

@effad have you had a chance to look at the rendering issues with 125% HiDPI scaling?

Unfortunately no, not yet. I had some troubles setting up the Windows build and a lot of other stuff to do.
But I will try to get things going this wednesday.

@effad
Copy link
Author

effad commented Apr 20, 2021

I've finally managed to build JavaFX under Windows and tried out MenuShowBug.java from JDK-8228363 under different setups:

JavaFX 16: Does not contain any fix for JDK-8228363 and thus will always show the menu at the wrong position when opened the first time.

PR-383: This was the version that used AnchorLocation. When using 125% DPI, it works well, but not perfect, i.e. when only one of my two screens is set to 125% DPI, gaps still appear sometimes. However this solution is unacceptable anyway, due to the issue described in JDK-8261840 (for which this PR is the fix).

PR-410 (i.e.: this PR): I can reproduce the problem of @kevinrushforth (i.e. gap on first click). Since up to JavaFX 16 the first opening of the menu never worked under any DPI setting, this is not a regression but rather another issue that we need to look into.

To be on the safe side, I also checked MenuShowBug without any stylesheets:

  • JavaFX 16: Works perfectly with 100% DPI, menu slightly too low with 125% DPI
  • PR-410: Works perfectly with 100% DPI, menu slightly too low with 125% DPI
    i.e. no difference.

@kevinrushforth
Copy link
Member

Thank you for your detailed explanation. I filed https://bugs.openjdk.java.net/browse/JDK-8265526 to track the issue of misaligned positioning with 125% scaling.

@openjdk
Copy link

openjdk bot commented Apr 20, 2021

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

8261840: Submenus close to screen borders are no longer repositioned

Reviewed-by: aghaisas, kcr

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

  • af75a1f: 8265439: [TestBug] Enable and fix ignored unit tests in MenuItemTest
  • e02cee9: 8264990: WebEngine crashes with segfault when not loaded through system classloader
  • a683558: 8259356: MediaPlayer's seek freezes video
  • 56f2e17: 8088739: [TestBug] RegionBackgroundImageUITest fail with timeout error
  • 8e54757: 8089589: [ListView] ScrollBar content moves toward-backward during scrolling.
  • 05ab799: 8208088: Memory Leak in ControlAcceleratorSupport
  • e8689fe: 8265031: Change default macOS min version for x86_64 to 10.12 and aarch64 to 11.0
  • c8384a1: 8264928: Update to Xcode 12.4
  • 808b107: 8260245: Update ICU4C to version 68.2
  • d808dd1: 8258663: Fixed size TableCells are not removed from sene graph when column is removed
  • ... and 31 more: https://git.openjdk.java.net/jfx/compare/9e42eea46d735f80235effdebb535ee66b59f7d1...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@aghaisas, @kevinrushforth) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Ready to be integrated label Apr 20, 2021
@effad
Copy link
Author

effad commented Apr 20, 2021

/integrate

@openjdk openjdk bot added the sponsor Ready to sponsor label Apr 20, 2021
@openjdk
Copy link

openjdk bot commented Apr 20, 2021

@effad
Your change (at version 9ff1be9) is now ready to be sponsored by a Committer.

@aghaisas
Copy link
Collaborator

/sponsor

@openjdk openjdk bot closed this Apr 20, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed sponsor Ready to sponsor ready Ready to be integrated rfr Ready for review labels Apr 20, 2021
@openjdk
Copy link

openjdk bot commented Apr 20, 2021

@aghaisas @effad Since your change was applied there have been 41 commits pushed to the master branch:

  • af75a1f: 8265439: [TestBug] Enable and fix ignored unit tests in MenuItemTest
  • e02cee9: 8264990: WebEngine crashes with segfault when not loaded through system classloader
  • a683558: 8259356: MediaPlayer's seek freezes video
  • 56f2e17: 8088739: [TestBug] RegionBackgroundImageUITest fail with timeout error
  • 8e54757: 8089589: [ListView] ScrollBar content moves toward-backward during scrolling.
  • 05ab799: 8208088: Memory Leak in ControlAcceleratorSupport
  • e8689fe: 8265031: Change default macOS min version for x86_64 to 10.12 and aarch64 to 11.0
  • c8384a1: 8264928: Update to Xcode 12.4
  • 808b107: 8260245: Update ICU4C to version 68.2
  • d808dd1: 8258663: Fixed size TableCells are not removed from sene graph when column is removed
  • ... and 31 more: https://git.openjdk.java.net/jfx/compare/9e42eea46d735f80235effdebb535ee66b59f7d1...master

Your commit was automatically rebased without conflicts.

Pushed as commit 67828ae.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants