RFR: 8267160: Monocle mouse never get ENTERED state
Johan Vos
jvos at openjdk.java.net
Fri May 14 15:58:39 UTC 2021
On Fri, 14 May 2021 15:37:38 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> allow to pass a fallback window in case the existing one is null (or can't be computed).
>>
>> Fix for JDK-8267160
>
> modules/javafx.graphics/src/main/java/com/sun/glass/ui/monocle/MouseState.java line 94:
>
>> 92: */
>> 93: MonocleWindow getWindow(boolean recalculateCache, MonocleWindow fallback) {
>> 94: if (recalculateCache) {
>
> Two questions:
>
> 1. It looks like `fallback` is effectively unused (always null). Did you add this for a future use case?
> 2. Unless I'm missing something, the only behavioral change is that it no longer executes the `if` block when the window is null if `recalculateCache` is false.
true to both questions.
The reason for this change is that this is now doing the same as what is done in `monocle.TouchState` and `monocle.TouchInput`.
TBH, I would prefer a different approach, where no fallback is passed, and the `if` block is only executed when `recalculateCache` is set to `true`. The only case where this `getWindow` method is invoked, is from `MouseInput` and it is only used to detect if the "old" window is different from the current window. Hence, it all seems a bit overkill to me, but for some reason, I thought keeping things consistent (mouseState versus TouchState) would make sense.
If you are ok with it, I can simply rewrite this without looking at the TouchState case?
-------------
PR: https://git.openjdk.java.net/jfx/pull/502
More information about the openjfx-dev
mailing list