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

Component.getMousePosition works incorrectly for overlapping toplevels

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 6
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b53
    • CPU:
      generic
    • OS:
      generic

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: