Some news. After some testing, in my opinion the problem lies when we destroy and recreate popupmenu handles in the Popup() method:
Hmm, rather sadly, thats not exactly limited to Qt5 and SysTray, that method is in ./lcl/include/popupmenu.inc and might have quite wide reaching implications.
Have you checked for, eg, memory leaks ? My guess is we'd need to work out why those two lines were put in there in the first place to be sure they are not needed on some other platform, some other widget set...
> And the right click -> QT's context menu doesn't have much to do with it. I was able to simulate the problem even just using the left click
Yes, so was I, I did not try right click, doing left click three times and cancelling on the SysTray will crash on KDE/Qt5
> Edit: Same bug when assign the popupmenu to Form1.PopupMenu.
I cannot replicate that. You mean assigning a popupmenu to the form's popupmenu property and doing the same repeated clicks thing ?
Davo
EDIT: I guess the real issue is can we be sure this is a Lazarus bug ? Sure looks like it but those two lines of code you chopped out don't do any harm with the other widgets ......