Forum > QT

Strange bug in QT Trayicon's PopupMenu

(1/2) > >>

El Salvador:
Hello everybody,

in my project I use Trayicon and in widgetset QT (os KDE Neon) I have a strange bug about its popupMenu. Basically, I use both the left click (OnClick event) and the right click (PopupMenu property) on the trayicon to show the popupMenu. The popup menu has some menu items, including the one to close the program.

If I RIGHT click on trayicon and then on the menu item Exit, the software closes correctly.

If I LEFT click on trayicon, close the popup menu (without clicking on Exit) and then I open the popup menu again with the RIGHT click and then click on Exit, then nothing will happen or it will go to SigSegv.

I have attached a demo project which reproduces the problem.

Furthermore, I also tried to download and compile the git version of Tomboy-ng and it has the same problem. But the official version from the ubuntu repositories works great. Could it be a regression? @dbannon, what version of Lazarus do you use to distribute tomboy-ng on Ubuntu?

Thank you everybody

Edit: Tried with Lazarus 2.0.10 and Trunk.

dbannon:
Hm, interesting.

I compile my tomboy-ng releases with FPC320 and Lazarus Trunk but the debian autobuilds uses Lazarus 2.0.12 (from memory) and I have not had any reports of that problem.

Are you capturing the right click and using that event to trigger the menu ?  I don't think you should, the KNSI (KSNI ?) spec allows only one event back and that is internally directed to the popup menu.  Some OSs will use the right click to manage thinks like systray location, size etc.  And KDE is home to that spec ...

So, if there are any, try removing any events coming back to your app.

Davo

El Salvador:

--- Quote from: dbannon on May 01, 2021, 10:09:00 am ---Are you capturing the right click and using that event to trigger the menu ?

--- End quote ---
 
Nope. This is another issue (QSystemTrayIcon::ActivationReason doesn't fire with right click), but it is KDE & QT fault and I gave up.


--- Quote from: dbannon on May 01, 2021, 10:09:00 am ---I don't think you should, the KNSI (KSNI ?) spec allows only one event back and that is internally directed to the popup menu.  Some OSs will use the right click to manage thinks like systray location, size etc.  And KDE is home to that spec ...
--- End quote ---
 
I don't know this spec (free desktop spec?), but I did other tests with my simple demo. If I open the popup menu several times with the left click, on the third click the program will go to SIGSEGV (in KstatusNotifier internals).

Basically:
1 Left click on the icon -> show popup menu
- Click on taskbar / form to close the popup menu
2 Left click on the icon -> show popup menu
- Click on taskbar / form to close the popup menu
3 Left click on the icon -> SigSegv

dbannon:

--- Quote from: El Salvador on May 01, 2021, 11:15:15 am ---.....
doesn't fire with right click), but it is KDE & QT fault and I gave up.

--- End quote ---
No, I am afraid thats intentional.   AppIndicator / KNSI thingo - all you can do is assign a menu and respond to those menu events, no right click, no double click.  A lot depends on your desktop, some still support the older SystemTray standard but its becoming fewer.



--- Quote from: El Salvador on May 01, 2021, 11:15:15 am ---Basically:
1 Left click on the icon -> show popup menu
- Click on taskbar / form to close the popup menu
2 Left click on the icon -> show popup menu
- Click on taskbar / form to close the popup menu
3 Left click on the icon -> SigSegv

--- End quote ---

Well, I cannot replicate that, tried in two Linux env, you are using Linux I guess ?  I don't have a KDE VM at the moment, can you test for this problem on some other desktop ?

So, its just a demo, one you can post here ?

Davo

El Salvador:

--- Quote ---No, I am afraid thats intentional.   AppIndicator / KNSI thingo - all you can do is assign a menu and respond to those menu events, no right click, no double click.  A lot depends on your desktop, some still support the older SystemTray standard but its becoming fewer.
--- End quote ---
Yes, it is intentional in Linux. I checked QT/KDE sources.



--- Quote ---Well, I cannot replicate that, tried in two Linux env, you are using Linux I guess ?  I don't have a KDE VM at the moment, can you test for this problem on some other desktop ?
--- End quote ---
KDE Neon. Next week I will try on Kubuntu 21.04. Anyway I just tried github release of tomboy-ng in KDE Neon. Same bug. Probably I will make a QT project in C++, to test this behaviour. Maybe is it a QT/KDE bug?


--- Quote ---So, its just a demo, one you can post here ?
--- End quote ---
See my first post.

Navigation

[0] Message Index

[#] Next page

Go to full version