Combo box menu flickering (with multiple combo boxes)


#1

When having 2 (or more) combo boxes, if you open the menu of the 2nd one while the menu of the other one is open, you often get a flicker (behaviour depends the speed of the click and if the menu takes time to create/show up I think).

to reproduce (with code below to simply replace the Misc page of the tabs&widgets demo) :

  • click on the first Combobox to open the menu
  • click slowly on the second one (staying a bit with the button down helps seeing the flickering/understanding the bug)

.

struct MiscPage   : public Component
{
    MiscPage() : comboBox1 ("Combo1"), comboBox2 ("Combo2")
    {
        addAndMakeVisible (comboBox1);
        addAndMakeVisible (comboBox2);
        comboBox1.setBounds (10, 85, 200, 24);
        comboBox2.setBounds (300, 85, 200, 24);

        for (int i = 1; i < 10; ++i)
        {
            comboBox1.addItem ("item " + String (i), i);
            comboBox2.addItem ("item " + String (i), i);
        }
    }

    ComboBox comboBox1, comboBox2;
};

ComboBox bug that causes flickering when opening a second ComboBox
#2

I believe the correct UI design is that you shouldn’t be allowed to have 2 ComboBox menus open at the same time… for instance check out MacOS Mail Prefs… if you click on anything outside a ComboBox menu it should close the menu. This is the cause of the ComboBox issue when used in Plugins where the menu can become detached from the parent if the Editor is moved while a ComboBox menu is open.

Rail


#3

yes, I’m not expecting the 2 menus to be opened at the same time. What Im expecting is the first menu to close, and the second one to open. This is what happens, but with flickering on the 2nd menu.

edit : this flickering is due to ComboBox::hidePopup() which dismiss all the active menus, and not only the one that is attached to the combobox.