Skip to content

Conversation

@ktakakuri
Copy link
Member

@ktakakuri ktakakuri commented Aug 20, 2024

This is a backport of JDK-8189687: Swing: Invalid position of candidate pop-up of InputMethod in Hi-DPI on Windows.
JDK-8189687 contains two fixes to AwtComponent:.OpenCandidateWindow, one of which is backported in this pull request.
The other fix is an enhancement to JEP 263 (JDK-8055212) and is not needed since JDK8 does not implement JEP 263.

  1. Fix to make OpenCandidateWindow reference the correct Window
    Fix OpenCandidateWindow to reference the proxy window that has focus when getting "HWND."
--- a/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
@@ -3880,19 +3880,21 @@ void AwtComponent::OpenCandidateWindow(int x, int y)
 {
     UINT bits = 1;
     POINT p = {0, 0}; // upper left corner of the client area
-    HWND hWnd = GetHWnd();
+    HWND hWnd = ImmGetHWnd();
     if (!::IsWindowVisible(hWnd)) {
         return;
     }
  1. Scaling fixes to enhance JDK-8073320
    OpenJDK9 has supported HiDPI Graphics since JEP 263 (JDK-8055212). This fix is one of its enhancements: when OpenCandidateWindow opens an IME conversion candidate, it corrects the coordinates for the device.

In the attached test that reproduces the issue problem, the Panel containing the TextField is a child component, so it refers to the wrong window to get the position coordinate of the candidate window.
Therefore, the candidate window will appear in the correct position with the "1" fix.
Note that OpenJDK8 does not implement JEP 263, so the "2" fix is not included in this pull request.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8189687 needs maintainer approval

Issue

  • JDK-8189687: Swing: Invalid position of candidate pop-up of InputMethod in Hi-DPI on Windows (Bug - P3 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/564/head:pull/564
$ git checkout pull/564

Update a local copy of the PR:
$ git checkout pull/564
$ git pull https://git.openjdk.org/jdk8u-dev.git pull/564/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 564

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/564.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 20, 2024

👋 Welcome back ktakakuri! 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 bot commented Aug 20, 2024

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

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

8189687: Swing: Invalid position of candidate pop-up of InputMethod in Hi-DPI on Windows

Reviewed-by: phh

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 (@phohensee) 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 changed the title Backport 489e5ae3349370825b7faa1d7514796a2b1ac1c7 8189687: Swing: Invalid position of candidate pop-up of InputMethod in Hi-DPI on Windows Aug 20, 2024
@openjdk
Copy link

openjdk bot commented Aug 20, 2024

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport Port of a pull request already in a different code base rfr Pull request is ready for review labels Aug 20, 2024
@mlbridge
Copy link

mlbridge bot commented Aug 20, 2024

Webrevs

@openjdk
Copy link

openjdk bot commented Aug 21, 2024

⚠️ @ktakakuri This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@ktakakuri
Copy link
Member Author

/approval request This bug is reproducible in JDK8, and backporting this patch is needed. JDK-8189687 contains two fixes to AwtComponent:.OpenCandidateWindow, one of which is backported in this pull request. The other fix is an enhancement to JEP 263 (JDK-8055212) and is not needed since JDK8 does not implement JEP 263.

@openjdk
Copy link

openjdk bot commented Aug 22, 2024

@ktakakuri
8189687: The approval request has been created successfully.

@openjdk openjdk bot added the approval Requires approval; will be removed when approval is received label Aug 22, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 19, 2024

@ktakakuri This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@ktakakuri
Copy link
Member Author

This pull request is pending approval of the Fix Request.
I comment to not close.

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 22, 2024

@ktakakuri This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@ktakakuri
Copy link
Member Author

This pull request is pending approval of the Fix Request.
I comment to not close.

@stooke
Copy link
Contributor

stooke commented Nov 1, 2024

(Disclaimer: I am not an official reviewer)
I have reproduced the issue, reviewed and tested this change and the tier1 Windows failures which are all certificate failures (unrelated), and my opinion is that this is good to go.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed approval Requires approval; will be removed when approval is received labels Nov 1, 2024
@stooke
Copy link
Contributor

stooke commented Nov 1, 2024

/approve

@openjdk
Copy link

openjdk bot commented Nov 1, 2024

@stooke Only integrators for this repository are allowed to issue the /approve command.

@ktakakuri
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Nov 5, 2024

Going to push as commit 1d2f467.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 5, 2024
@openjdk openjdk bot closed this Nov 5, 2024
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Nov 5, 2024
@openjdk openjdk bot removed the rfr Pull request is ready for review label Nov 5, 2024
@openjdk
Copy link

openjdk bot commented Nov 5, 2024

@ktakakuri Pushed as commit 1d2f467.

💡 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

backport Port of a pull request already in a different code base integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants