Harmony
  1. Harmony
  2. HARMONY-5060

[classlib][swing] Can not move window showing popupMenu

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None
    • Environment:
      Win32

      Description

      Below is the simple reproducer.
      I only succeed in the first time when I try to move the window with the PopupMenu showing. After that I can not move the window if the popup menu is shown. After some tracing I see that the window can be moved because the WM_CAPTURECHANGED event is generated and handled. But generally there are only MOUSE_PRESSED events instead of the WM_CAPTURECHANGED event.

      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class PopupMenuDemo extends JPanel {
      public PopupMenuDemo() {
      super(new BorderLayout());

      String[] theStrings =

      { "First", "Second", "Third", "Fourth" }

      ;
      JComboBox theList = new JComboBox(theStrings);
      add(theList, BorderLayout.PAGE_START);
      }

      public static void main(String[] args)

      { JFrame frame = new JFrame("PopupMenuDemo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JComponent newContentPane = new PopupMenuDemo(); newContentPane.setOpaque(true); //content panes must be opaque frame.setContentPane(newContentPane); frame.setBounds(100, 100, 200, 50); //Display the window. frame.setVisible(true); }

      }

        Activity

        Chunrong Lai created issue -
        Andrey Pavlenko made changes -
        Field Original Value New Value
        Assignee Andrey Pavlenko [ apavlenko ]
        Hide
        Andrey Pavlenko added a comment -

        The attached patch fixes this issue, but might cause some other issues. I've tested this patch with several applications - no issues found.

        Show
        Andrey Pavlenko added a comment - The attached patch fixes this issue, but might cause some other issues. I've tested this patch with several applications - no issues found.
        Andrey Pavlenko made changes -
        Attachment HARMONY-5060-MouseGrab.patch [ 12371683 ]
        Andrey Pavlenko made changes -
        Attachment HARMONY-5060-MouseGrab.patch [ 12371683 ]
        Hide
        Andrey Pavlenko added a comment -

        The attached patch introduces new issues. This issue needs more investigation.

        Show
        Andrey Pavlenko added a comment - The attached patch introduces new issues. This issue needs more investigation.

          People

          • Assignee:
            Andrey Pavlenko
            Reporter:
            Chunrong Lai
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development