8375070: NPE in Scene.ClickGenerator::preProcess when mouse button is none#2034
8375070: NPE in Scene.ClickGenerator::preProcess when mouse button is none#2034crschnick wants to merge 5 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back crschnick! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
Webrevs
|
|
I'll try testing it, but it would be nice to learn more about the actual failure mode - which mouse model, which driver, etc. |
|
Yeah I would like to know as well, but that's the thing with user reports. Often they don't follow up, but an initial report is still better than nothing |
|
The danger in such poorly understood cases is the risk of regression. This code was written in 2012 (or probably even earlier) and might have worked fine since then (or might not, it's hard to say). |
|
I've got the Logitech MX Anywhere 2S mouse with a bunch of extra buttons and no specially installed driver, and I cannot reproduce the exception with the latest master branch. |
|
Yes, I understand. The only reason I submitted this was because I have seen it multiple times now and the fix does not seem to have any adverse effects on other stuff. It should be reproducible in headless mode when sending an event manually. I will try to create a reproducer for that. |
|
/reviewers 2 |
|
@kevinrushforth |
|
I added a test case to reproduce this issue. I have two questions about the general workflow here:
|
An issue can be set to Confidential for a few different reasons. In the case of the bug you asked about -- JDK-8110944 -- the component being fixed (glass) was not open source yet (note the resolution date: it was fixed in 2011). The bug didn't need to be Confidential, but no one noticed or asked about it until now.
A constructed test case that fails before and passes after the fix is usually good enough as long as we understand why the failure is occurring and why the fix is the right one. So the questions being asked by @arapte are good questions to ask. |
|
So this is ready for review now with the test. I have searched the various error logs that people sent me about unrelated issues, and found that this NPE occured for at least 5 people that reported other issues. All of those were on macOS 26, so something probably changed in the input handling there. Maybe it's a weird edge case or some accessibility thing, but it it definitely occurs somehow. If someone with macos expertise wants to take a look at the root cause, then this can be fixed in a follow-up issue I guess. There is definitely something wrong in the input handling on macOS 26, I just can't pinpoint it yet |
A straightforward fix to just include MouseButton.NONE in the click counter map in cases weird mouse button events are sent. Alternatively, these events could also be ignored/dropped at some point
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/2034/head:pull/2034$ git checkout pull/2034Update a local copy of the PR:
$ git checkout pull/2034$ git pull https://git.openjdk.org/jfx.git pull/2034/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 2034View PR using the GUI difftool:
$ git pr show -t 2034Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/2034.diff
Using Webrev
Link to Webrev Comment