Bug 371510

Summary: tray context menu popup with window frame and taskbar entry
Product: [Frameworks and Libraries] frameworks-knotifications Reporter: nihui <shuizhuyuanluo>
Component: generalAssignee: Martin Klapetek <mklapetek>
Status: RESOLVED FIXED    
Severity: normal CC: kdelibs-bugs-null, mgraesslin, nate
Priority: NOR    
Version First Reported In: 5.26.0   
Target Milestone: ---   
Platform: Chakra   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: screenshot

Description nihui 2016-10-23 06:09:08 UTC
it may be a regression in the fix of bugs.kde.org/show_bug.cgi?id=335015

if the context menu is the associated widget, the menu will popup with ugly window frame and taskbar entry when activated.

Here is an example that reproduces this issue.

#include <QApplication>
#include <QAction>
#include <QMenu>
#include <KStatusNotifierItem>

int main(int argc, char** argv)
{
    QApplication app(argc, argv);

    QWidget mainwindow;

    KStatusNotifierItem* tray = new KStatusNotifierItem(&mainwindow);

    tray->setAssociatedWidget(tray->contextMenu());

    QAction* action1 = new QAction("action1", &mainwindow);
    QAction* action2 = new QAction("action2", &mainwindow);
    QAction* action3 = new QAction("action3", &mainwindow);
    tray->contextMenu()->addAction(action1);
    tray->contextMenu()->addAction(action2);
    tray->contextMenu()->addAction(action3);

    mainwindow.show();

    return app.exec();
}


Reproducible: Always

Steps to Reproduce:
1. compile and run my sample code
2. left click tray icon

Actual Results:  
tray context menu popup with window frame and taskbar entry

Expected Results:  
tray context menu popup without window frame or taskbar entry

chakra linux
qt 5.7.0
kde framework 5.26.0
kernel 4.5.7
Comment 1 nihui 2016-10-23 06:10:31 UTC
Created attachment 101711 [details]
screenshot

add screenshot
Comment 2 Christoph Feck 2016-10-24 04:02:13 UTC
That commit is quite old, but adding committer anyway for inspection.
Comment 3 Nate Graham 2021-08-09 17:07:53 UTC
This is fixed now.