https://bugs.kde.org/show_bug.cgi?id=395034

            Bug ID: 395034
           Summary: QMenu becomes invisible when cleared while still open
           Product: kwin
           Version: 5.12.5
          Platform: Archlinux Packages
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: compositing
          Assignee: kwin-bugs-n...@kde.org
          Reporter: farid.boude...@gmail.com
  Target Milestone: ---

Created attachment 113078
  --> https://bugs.kde.org/attachment.cgi?id=113078&action=edit
QMenu cleared by a timer with compositing enabled

When an open QMenu is cleared through a function triggered by a signal (e.g.
QTimer or a queued connection) it becomes invisible but its actions are
working.

The bug can be replicated using the following Qt app:

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QToolButton *button = new QToolButton(ui->mainToolBar);
    QMenu* menu = new QMenu(button);

    button->setText("Menu");
    button->setMenu(menu);
    button->setPopupMode(QToolButton::InstantPopup);

    QTimer* timer = new QTimer(this);
    connect(timer, &QTimer::timeout, this, [=](){
        menu->clear();
        menu->addAction("Menu 1");
        menu->addAction("Menu 2");
        menu->addAction("Menu 3");
    });
    timer->start(1000);

    ui->mainToolBar->addWidget(button);
}


- The menu should be cleared and populated every second but it appears and
disappears. (See attachment) 
- When compositing is disable it works as expected and does not disappear. (See
attachment)
- Although the menu is invisible it still works. (See attachment)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to