Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6293952

Component.getMousePosition works incorrectly for overlapping toplevels

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 5.0
    • client-libs
    • b53
    • generic
    • generic

      The spec for Component.getMouseInfo() says:

      --
      Returns the position of the mouse pointer in this Component's coordinate space if the Component is directly under the mouse pointer, otherwise returns null. If the Component is not showing on the screen, this method returns null even if the mouse pointer is above the area where the Component would be displayed. If the Component is partially or fully obscured by other Components or native windows, this method returns a non-null value only if the mouse pointer is located above the unobscured part of the Component.
      --

      The last sentence is about the cases when a component is overlapped by another components and toplevel windows. In that case if a window is obscured by another window, calling to its getMousePosition() should return null value, but it doesn't.

      Run the attached testcase. Two frames F1 and F2 will be shown, partially obscuring each other. Then the mouse pointer is moved to the region, where F1 and F2 intersect and getMousePosition() will be called for both frames. The result will be printed to the console. If you see two not-null points printed, the bug is reproduced.

      The bug can be reproduced always both on Windows and Solaris/Linux w/ XToolkit/MToolkit.

      ###@###.### 2005-07-04 14:28:02 GMT

            denis Denis Fokin (Inactive)
            art Artem Ananiev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: