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

8268877: TextInputControlSkin: incorrect inputMethod event handler after switching skin #903

Conversation

andy-goryachev-oracle
Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle commented Sep 27, 2022

Using new Skin.install() method to properly set and remove inputMethodRequests property in TextInputControl.

This avoids memory leaks resulting from skin change, as well as honors user-set properties when installing an uninstalling.

This PR depends on JDK-8290844 Skin.install().


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-8268877: TextInputControlSkin: incorrect inputMethod event handler after switching skin

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 903

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 27, 2022

👋 Welcome back angorya! 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.

@andy-goryachev-oracle andy-goryachev-oracle changed the title TextInputControlSkin: incorrect inputMethod event handler after switching skin 8268877: TextInputControlSkin: incorrect inputMethod event handler after switching skin Sep 27, 2022
@openjdk
Copy link

openjdk bot commented Nov 1, 2022

⚠️ @andy-goryachev-oracle This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@andy-goryachev-oracle andy-goryachev-oracle marked this pull request as ready for review November 3, 2022 16:50
@openjdk openjdk bot added the rfr Ready for review label Nov 3, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 3, 2022

Webrevs

@kevinrushforth
Copy link
Member

If this is changed to adding an EventHandler rather than calling setOnInputMethodTextChanged, do you still want / need to move the initialization logic to the Skin::install method? I presume you do, so we will need to highlight the potential behavioral incompatibility, in the API docs (maybe via an @implNote, since the only compatibility concern is with subclasses that make assumptions about undocumented behavior of their superclass) or a release note or both.

@andy-goryachev-oracle
Copy link
Contributor Author

do you still want / need to move the initialization logic to the Skin::install method?

good question. In the case of setOnInputMethodTextChanged -> control.addEventHandler(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED the code remains in the constructor, so no behavioral changes are expected.

But control.setInputMethodRequests(inputMethodRequests); must be done in install() since it's setting the property.

Another question is whether we should use ListenerHelper for control.addEventHandler(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED , but that would move this PR into a draft stage until ListenerHelper is integrated. Or perhaps it could be done as a part of JDK-8296076.

@kevinrushforth
Copy link
Member

do you still want / need to move the initialization logic to the Skin::install method?

good question. In the case of setOnInputMethodTextChanged -> control.addEventHandler(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED the code remains in the constructor, so no behavioral changes are expected.

But control.setInputMethodRequests(inputMethodRequests); must be done in install() since it's setting the property.

In that case, depending on which direction you go, we may or may not need an impl note (and I wouldn't bother with a release note, since I think the compatibility risk is small enough anyway; I could be talked into a release note if others feel differently).

Another question is whether we should use ListenerHelper for control.addEventHandler(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED , but that would move this PR into a draft stage until ListenerHelper is integrated. Or perhaps it could be done as a part of JDK-8296076.

Doing it as part of JDK-8296076 seems best.

@andy-goryachev-oracle
Copy link
Contributor Author

I wonder if this even needs an implementation note, as it is a bug fix.
We did add one in JDK-8292212 Skin.install(), should be sufficient.

@kevinrushforth
Copy link
Member

Maybe not then.

Copy link
Collaborator

@aghaisas aghaisas left a comment

Choose a reason for hiding this comment

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

Fix looks good to me!

@openjdk
Copy link

openjdk bot commented Nov 12, 2022

@andy-goryachev-oracle 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:

8268877: TextInputControlSkin: incorrect inputMethod event handler after switching skin

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

  • 5956950: 8285503: SwingNodeDnDMemoryLeakTest::testSwingNodeMemoryLeak fails sometimes
  • 0ee116d: 8296589: PixelBufferDrawTest fails on some systems
  • 7dc284d: 8221708: Update Eclipse project files
  • f4e27e9: 8222210: JFXPanel popups open at wrong coordinates when using multiple hidpi monitors
  • 706261b: 8296592: Skip failing test StraightLineTest on Linux
  • b08f135: 8296283: JUnit5 tests using Params API fails to compile

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 Nov 12, 2022
@andy-goryachev-oracle
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Ready to sponsor label Nov 14, 2022
@openjdk
Copy link

openjdk bot commented Nov 14, 2022

@andy-goryachev-oracle
Your change (at version 04f4911) is now ready to be sponsored by a Committer.

@kevinrushforth
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Nov 14, 2022

Going to push as commit a13630f.
Since your change was applied there have been 7 commits pushed to the master branch:

  • 7ec0852: 8291853: [CSS] ClassCastException in CssStyleHelper calculateValue
  • 5956950: 8285503: SwingNodeDnDMemoryLeakTest::testSwingNodeMemoryLeak fails sometimes
  • 0ee116d: 8296589: PixelBufferDrawTest fails on some systems
  • 7dc284d: 8221708: Update Eclipse project files
  • f4e27e9: 8222210: JFXPanel popups open at wrong coordinates when using multiple hidpi monitors
  • 706261b: 8296592: Skip failing test StraightLineTest on Linux
  • b08f135: 8296283: JUnit5 tests using Params API fails to compile

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 14, 2022
@openjdk openjdk bot closed this Nov 14, 2022
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review sponsor Ready to sponsor labels Nov 14, 2022
@openjdk
Copy link

openjdk bot commented Nov 14, 2022

@kevinrushforth @andy-goryachev-oracle Pushed as commit a13630f.

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

@andy-goryachev-oracle andy-goryachev-oracle deleted the 8268877.input.method branch November 14, 2022 18:39
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.

4 participants