JDK-6479820 : Spurious entry/exit mouse events
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-10-09
  • Updated: 2011-05-18
  • Resolved: 2011-05-18
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 b21Fixed
Related Reports
Relates :  
Description
J2SE Version (please include all output from java -version flag):
W:\borsotti\jtest>java -version
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b98)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b98, mixed mode, sharing)

Does this problem occur on J2SE 1.4.x or 5.0.x ?  Yes / No (pick one)
not known

Operating System Configuration Information (be specific):
Windows XP Professional SP2


Hardware Configuration Information (be specific):
Intel Pentium III, 730 Mhz, 384 Mb RAM


Bug Description:
When resizing the window by dragging a corner with the mouse,
the panel receives entry/exit mouse events randomly.
These events should not occur because the mouse is not entering
or exiting the window, it is dragging a corner of its border.

Steps to Reproduce (be specific):

Compile and run the attached program. A window is displayed.
Move the mouse over a corner and drag it back and forth several
times. On the command prompt window, entry and exit mouse events
are traced. See the attached image that documents it.

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/awt_data/7/6479820.2
24-08-2007

EVALUATION Considering a TrackMouseEvent() function supposes much more coding for this particular case.
13-07-2007

EVALUATION The bug is only reproducible when mouse is changing the component under. This is usually happens with mouse move outside the toplevel. AwtToolkit::PreProcessMouseMsg does the following: 1) get coords of event 2) get HWND under the pointer via WindowFromPoint() 3) if new coords are outside of the window then erase mouseComp value 4) then compare previusly stored component (m_lastMouseOver) with mouseComp. If they are not equals then fire a WM_AWT_MOUSEEXIT message. So far this happens when system is not fast enough to resize native component in a short period of time while message is on its way. From this point I'm not very surprised with this issue. The idea of the fix would be to pick up AwtWindow.m_resizing value and not consider any messages in PreProcessMouseMsg until m_resizing is true.
16-10-2006

EVALUATION I'm able to reproduce the bug only if I resize the frame pretty fast. I suspect there is a lack of synchronization between AWT mouse native and Java events, and probably something else.
11-10-2006