JDK-6844270 : Mouse hot-plugging should work consistent for SunToolkit and MouseInfo classes
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: generic
  • CPU: generic
  • Submitted: 2009-05-22
  • Updated: 2011-06-23
  • Resolved: 2011-06-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7-poolResolved
Related Reports
Relates :  
Description
Now the MouseInfo.getNumberOfButtons() method deals with the desktop property which is installed only once (at the toolkit init) and then remains the same. At the same time, SunToolkit (well, the underlying concrete toolkit class) goes into the native system for property value when we call its method getNumberOfButtons(). That means that the number of buttons will vary for these two approaches when somebody will change the mouse device on-the-fly.
Moreover, the spec for the MouseInfo class says that it returns the number of buttons on the mouse. I'd read it that it will always report *actual* mouse buttons number even if I change the mouse itself. But as already mentioned in the first sentence, now we return some cached number of buttons which isn't aligned with the spec.

Comments
EVALUATION Current implementations of our Toolkits cache it
23-06-2011

EVALUATION From the very beginning the MouseInfo class operate through the desktop property map. We should align the implementatin with the spec: either pick number of buttons every time from the native system, either cache it only once including SunToolkit.
22-05-2009