[macosx] Programmatically selecting/deselecting List item triggers an ItemEvent

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P3
    • tbd
    • Affects Version/s: 17, 25, 26
    • Component/s: client-libs
    • generic
    • os_x

      When I was working on JDK-8369327 I got a suggestion to update the code that disables unnecessary events:
      https://github.com/openjdk/jdk/pull/27682#discussion_r2487686109

      After checking that code more closely, I found that it does not work in all cases. The checks were first added in JDK-7125456. It looks like only the case for the select method was fixed. Other cases still cause unnecessary events, and even more events happen when trying to add multi selection mode: https://github.com/openjdk/jdk/pull/27682#issuecomment-3487434403

      So I made a new bug for this issue and fixed it separately.

      The spec:
      https://github.com/openjdk/jdk/blob/8531fa146be1da5e96c0f23091882a27c67d7893/src/java.desktop/share/classes/java/awt/List.java#L899
           * Adds the specified item listener to receive item events from
           * this list. Item events are sent in response to user input, but not
           * in response to calls to {@code select} or {@code deselect}.

            Assignee:
            Sergey Bylokhov
            Reporter:
            Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: