Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread John Hendrikx
On Thu, 13 Oct 2022 23:45:10 GMT, Andy Goryachev wrote: > 1. it looks like your proposal will work, as long as the `active` property is > not referenced outside of its owner (in our discussion, Skin). If that is > true, as soon as you set active=false, the listener is disconnected and the >

Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread John Hendrikx
On Thu, 29 Sep 2022 15:02:13 GMT, John Hendrikx wrote: >> This PR adds a new (lazy*) property on `Node` which provides a boolean which >> indicates whether or not the `Node` is currently part of a `Scene`, which in >> turn is part of a currently showing `Window`. >> >> It also adds a new

Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread Andy Goryachev
On Thu, 13 Oct 2022 23:25:05 GMT, John Hendrikx wrote: >> let me try to create a unit test (and I could be wrong, of course). > >> In the context of this PR, I can see how a memory leak can be created when a >> developer has the `active` property as long lived and that would prevent the >>

Re: RFR: 8287822: [macos] Remove support of duplicated formats from macOS [v3]

2022-10-13 Thread Alexander Matveev
On Thu, 13 Oct 2022 22:24:06 GMT, Andy Goryachev wrote: >> Alexander Matveev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8287822: [macos] Remove support of duplicated formats from macOS [v3] > >

Re: RFR: 8287822: [macos] Remove support of duplicated formats from macOS [v3]

2022-10-13 Thread Alexander Matveev
On Thu, 13 Oct 2022 22:23:08 GMT, Andy Goryachev wrote: >> Related question: Can `uri` itself be null? > > so the logic seems to be either a "jar", or else it's a file, right? > is it possible to be something else (i.e. the resource is missing > altogether)? or some other condition? Yes, when

Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread John Hendrikx
On Thu, 13 Oct 2022 23:13:25 GMT, Andy Goryachev wrote: >>> Also, using your example above, it might be too easy to create a memory >>> leak by inadvertently referring to a long lived object: >>> >>> ``` >>> getSkinnable().textProperty().when(active).addListener((src,prev,current) >>> -> {

Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread Andy Goryachev
On Thu, 29 Sep 2022 15:02:13 GMT, John Hendrikx wrote: >> This PR adds a new (lazy*) property on `Node` which provides a boolean which >> indicates whether or not the `Node` is currently part of a `Scene`, which in >> turn is part of a currently showing `Window`. >> >> It also adds a new

Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread Andy Goryachev
On Thu, 13 Oct 2022 23:03:56 GMT, John Hendrikx wrote: >> Also, using your example above, it might be too easy to create a memory leak >> by inadvertently referring to a long lived object: >> >> >> getSkinnable().textProperty().when(active).addListener((src,prev,current) -> >> { >>

Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread John Hendrikx
On Thu, 13 Oct 2022 23:06:05 GMT, Andy Goryachev wrote: > I am late to the party (should have commented in #675) - "Subscription" is > way too generic and overloaded word for a functional interface. Any one who > is using real Subscriptions will get confused ;-) > > Probably too late to

Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread John Hendrikx
On Thu, 13 Oct 2022 22:17:09 GMT, Andy Goryachev wrote: > Also, using your example above, it might be too easy to create a memory leak > by inadvertently referring to a long lived object: > > ``` > getSkinnable().textProperty().when(active).addListener((src,prev,current) -> { >

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners

2022-10-13 Thread Andy Goryachev
On Fri, 7 Oct 2022 20:50:55 GMT, Andy Goryachev wrote: > Introduction > > There is a number of places where various listeners (strong as well as weak) > are added, to be later disconnected in one go. For example, Skin > implementations use dispose() method to clean up the listeners installed

Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread Andy Goryachev
On Thu, 13 Oct 2022 22:11:12 GMT, Andy Goryachev wrote: >> Thank you for explanations, @hjohn . >> >> This *might* work for Skins, of course, though it is not exactly what is >> needed for Skins (I will explain why in >> https://github.com/openjdk/jfx/pull/908 because of context). >> >> In

Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread Andy Goryachev
On Thu, 13 Oct 2022 22:06:15 GMT, Andy Goryachev wrote: >> Since this was quite wordy, and since pictures are worth a thousand words... >> >> Here is the situation when you have a Label with its Skin: >> >>

Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread Andy Goryachev
On Thu, 13 Oct 2022 21:03:36 GMT, John Hendrikx wrote: >> I'm not sure I fully understand what you mean here with the transient nodes, >> so if you have an example where you think this doesn't work as you'd like, >> I'd be happy to take a look at it. However, I'll try explain though what's

Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread John Hendrikx
On Thu, 13 Oct 2022 20:42:31 GMT, John Hendrikx wrote: >> modules/javafx.base/src/main/java/com/sun/javafx/binding/ConditionalBinding.java >> line 19: >> >>> 17: >>> 18: // condition is always observed and never unsubscribed >>> 19: Subscription.subscribe(nonNullCondition,

Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread John Hendrikx
On Thu, 13 Oct 2022 15:52:46 GMT, Andy Goryachev wrote: >> John Hendrikx has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains ten commits: >> >> - Merge remote-tracking branch 'origin/master' into >>feature/conditional-bindings

Re: RFR: 8260528: Clean glass-gtk sizing and positioning code [v27]

2022-10-13 Thread Thiago Milczarek Sayao
On Mon, 28 Jun 2021 23:50:31 GMT, Thiago Milczarek Sayao wrote: >> This is a new approach to rewrite parts of gtk glass backend to be more >> clean. >> >> I will provide small "manageable" PR to incrementally make the backend >> better. >> >> This PR adresses cleanup of the Size and

Re: RFR: 8290040: Provide simplified deterministic way to manage listeners [v6]

2022-10-13 Thread Andy Goryachev
On Thu, 29 Sep 2022 15:02:13 GMT, John Hendrikx wrote: >> This PR adds a new (lazy*) property on `Node` which provides a boolean which >> indicates whether or not the `Node` is currently part of a `Scene`, which in >> turn is part of a currently showing `Window`. >> >> It also adds a new

Re: RFR: JDK-8295236: Update JavaDoc in javafx.geometry.Point3D

2022-10-13 Thread Kevin Rushforth
On Thu, 13 Oct 2022 14:14:44 GMT, Nir Lisker wrote: >> The JavaDoc for equals had a copy/paste error. I normalized the text based >> on the JavaDoc for method java.awt.Point#equals. I also changed formatting >> in the method signatures of equals(), hashCode() and toString(). >> >> For good

Re: RFR: JDK-8295236: Update JavaDoc in javafx.geometry.Point3D

2022-10-13 Thread Kevin Rushforth
On Wed, 12 Oct 2022 17:28:42 GMT, Douglas Held wrote: > The JavaDoc for equals had a copy/paste error. I normalized the text based on > the JavaDoc for method java.awt.Point#equals. I also changed formatting in > the method signatures of equals(), hashCode() and toString(). > > For good

Re: RFR: JDK-8295236: Update JavaDoc in javafx.geometry.Point3D

2022-10-13 Thread Nir Lisker
On Wed, 12 Oct 2022 17:28:42 GMT, Douglas Held wrote: > The JavaDoc for equals had a copy/paste error. I normalized the text based on > the JavaDoc for method java.awt.Point#equals. I also changed formatting in > the method signatures of equals(), hashCode() and toString(). > > For good

RFR: JDK-8295236: Update JavaDoc in javafx.geometry.Point3D

2022-10-13 Thread Douglas Held
The JavaDoc for equals had a copy/paste error. I normalized the text based on the JavaDoc for method java.awt.Point#equals. I also changed formatting in the method signatures of equals(), hashCode() and toString(). For good measure, some kind of copy/paste detection should probably be added to

Re: RFR: JDK-8295236: Update JavaDoc in javafx.geometry.Point3D

2022-10-13 Thread Kevin Rushforth
On Wed, 12 Oct 2022 17:28:42 GMT, Douglas Held wrote: > The JavaDoc for equals had a copy/paste error. I normalized the text based on > the JavaDoc for method java.awt.Point#equals. I also changed formatting in > the method signatures of equals(), hashCode() and toString(). > > For good

Re: Negative coordinates do not work on Linux(Gnome), but on Windows

2022-10-13 Thread Dirk Lemmermann
Should someone want to look into this issue then I can recommend using the ScreensView in the GemsFX project for debugging purposes. You can see it here: https://www.youtube.com/watch?v=Kv7jo9fF9tc Dirk > On 11 Oct 2022, at 23:21, Tom Schindl

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners

2022-10-13 Thread Nir Lisker
Hi, I agree with John. The work on managing listeners has been in the works for a long while now and it provides a lot more flexibility for less technical debt. I have already reviewed his 'when' proposal (sans its implementation on Node) and I think that it's the way to go. Fluent bindings

Re: RFR: 8294809: ListenerHelper for managing and disconnecting listeners

2022-10-13 Thread John Hendrikx
Hi Andy, There is another PR that will help with this: https://github.com/openjdk/jfx/pull/830 It adds a `when` method on `ObservableValue`:   default ObservableValue when(ObservableValue condition) This method can be used for all kinds of things, and one of them is that it could be