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

8331319: IME Window breaks after popup menu #1447

Closed
wants to merge 1 commit into from

Conversation

beldenfox
Copy link
Contributor

@beldenfox beldenfox commented Apr 30, 2024

When focus moves away from a node JavaFX calls finishInputMethodComposition so glass can clean up any in-progress IME editing. On Mac we call discardMarkedText on the view's NSTextInputContext to dismiss the IME.

It appears that the OS can get confused if discardMarkedText is called on an NSTextInputContext that is not the current active context. JavaFX popups are displayed in windows that don't have OS focus and therefore do not have the active input context but the JavaFX scene associated with the popup doesn't know this and still makes calls to manipulate the IME. This seems to be triggering a bug in the OS that leads to bad behavior which persists until the user moves focus away from the main JavaFX stage altogether and then brings it back.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8331319: IME Window breaks after popup menu (Bug - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1447/head:pull/1447
$ git checkout pull/1447

Update a local copy of the PR:
$ git checkout pull/1447
$ git pull https://git.openjdk.org/jfx.git pull/1447/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1447

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1447.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 30, 2024

👋 Welcome back mfox! 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 Apr 30, 2024

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

8331319: IME Window breaks after popup menu

Reviewed-by: kcr, angorya

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.

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

@openjdk openjdk bot added the rfr Ready for review label Apr 30, 2024
@kevinrushforth
Copy link
Member

Reviewers: @andy-goryachev-oracle @kevinrushforth

/reviewers 2

@kevinrushforth kevinrushforth self-requested a review April 30, 2024 14:55
@openjdk
Copy link

openjdk bot commented Apr 30, 2024

@kevinrushforth
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@mlbridge
Copy link

mlbridge bot commented Apr 30, 2024

Webrevs

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I verified on my macOS 13.6.6 system that this fixes the problem. I also verified that the test program from JDK-8320912 still works correctly.

@andy-goryachev-oracle
Copy link
Contributor

Seems to work with the little test program.

Observed a weird behavior in the Monkey Tester
https://github.com/andy-goryachev-oracle/MonkeyTest

  • open TextArea page
  • set font to System Regular
  • select text: "Writing Systems"
  • click on any English word, invoke IME (I use Japanese), observe candidate inserted correctly
  • click on non-English word, invoke IME, the candidate is still shows up correctly
  • click on an English word, invoke IME and the candidate shows garbage.

It seems to me it might be using font from the previous invocation?
This could be a different issue though.

Screenshot 2024-04-30 at 08 18 55

@kevinrushforth
Copy link
Member

That seems likely a different issue. Can you try it with a build without the current PR? And maybe also try it with JavaFX 22 to rule out other recently-introduced problems?

@andy-goryachev-oracle
Copy link
Contributor

andy-goryachev-oracle commented Apr 30, 2024

same issue without the fix. I agree - this is likely unrelated.

I won't be able to try with an earlier jdk in the next couple of hours, sorry.

@andy-goryachev-oracle
Copy link
Contributor

With jfx21-ea+12, I see the same incorrect font, so it must be a different issue.

java --module-path "REDACTED/Java/javafx-sdk-21/lib" --add-modules javafx.base,javafx.graphics,javafx.controls,javafx.swing,javafx.web -jar "REDACTED/MonkeyTest2/MonkeyTest/dist/MonkeyTester.jar"

Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ship it!

@openjdk openjdk bot added the ready Ready to be integrated label Apr 30, 2024
@beldenfox
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Apr 30, 2024

Going to push as commit cac81b5.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 30, 2024
@openjdk openjdk bot closed this Apr 30, 2024
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review labels Apr 30, 2024
@openjdk
Copy link

openjdk bot commented Apr 30, 2024

@beldenfox Pushed as commit cac81b5.

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

@beldenfox beldenfox deleted the macpopupimebug branch July 23, 2024 18:46
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