D24755: [KStatusNotifierItem] Optionaly, do not take menu ownership

Konrad Materka noreply at phabricator.kde.org
Sat Oct 19 17:14:36 BST 2019


kmaterka added inline comments.

INLINE COMMENTS

> anthonyfieroni wrote in kstatusnotifieritem.cpp:790
> That's easy checkable
> 
>   if (!qApp->closingDown() && (!d->menu->parent() || d->menu->parent() == d->associatedWidget) {
>       delete d->menu;
>   }
> 
> We should not own the menu, that's not tight approach at least.

This check is not reliable, assosiatedWidget can change. Anyway, this doesn't matter here.
Did you read whole comment? Probably KSNI should not own the menu but it is doing that for 10 (more?) years. It is even documented in the API.
Your idea will not fix the main issue, we can't set a parent to menu in KDEPlatformSystemTrayIcon. Main purpose of this hack is to prevent deletion of menu when it is *not* possible to set parent.

REPOSITORY
  R289 KNotifications

REVISION DETAIL
  https://phabricator.kde.org/D24755

To: kmaterka, #frameworks, davidedmundson, broulik, nicolasfella
Cc: anthonyfieroni, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191019/dec24a44/attachment.html>


More information about the Kde-frameworks-devel mailing list