← Back to team overview

dx-packages team mailing list archive

[Bug 1574699] Re: All QSystemTrayIcon have the same icon, and QSystemTrayIcon::isSystemTrayAvailable remove all QSystemTrayIcon

 

** Description changed:

- in qppmenu-qt5 in ubuntu 16.4, the  AppMenuPlatformSystemTrayIcon
- assumes there is only one instance of a QPlatformSystemTrayIcon: it
- register the same sbus name for all the instances.  In fact, there is
- one instance of QPlatformSystemTrayIcon per instance of QSystemTrayIcon,
- and one temporary is created for QSystemTrayIcon::isSystemTrayAvailable.
+ # Impact
+ This affects all Qt applications that use QSystemTrayIcon::​isSystemTrayAvailable, in Unity environment. Confirmed examples are owncloud-client and keepassxc, but there may be more applications.
  
+ # Test Case
+ See the original description below for the test case in C++.
  
- This breaks the owncloud client  [issue https://github.com/owncloud/client/issues/4693 ]
+ # Proposed Fix
+ The proposed fix is identical to what was uploaded to Yakkety as version 0.3.0+16.10.20160628.1-0ubuntu1. The fix is using unique connections for all AppMenuPlatformSystemTrayIcon instances.
  
+ # Regression Potential
+ The fix is in Yakkety since June and in Zesty, and nobody complained so far. So it should not cause any regressions.
+ 
+ -----------------------------------------------------------------------------
+ in appmenu-qt5 in ubuntu 16.04, the  AppMenuPlatformSystemTrayIcon assumes there is only one instance of a QPlatformSystemTrayIcon: it register the same dbus name for all the instances.  In fact, there is one instance of QPlatformSystemTrayIcon per instance of QSystemTrayIcon,  and one temporary is created for QSystemTrayIcon::isSystemTrayAvailable.
+ 
+ This breaks the owncloud client  [issue
+ https://github.com/owncloud/client/issues/4693 ]
  
  This example reproduces the problem:
  
  ```
  #include <QtWidgets>
  
  int main(int argc, char *argv[])
  {
-     QApplication a(argc, argv);
-     QImage img(64,64, QImage::Format_ARGB32);
-     img.fill(Qt::red);
-     QSystemTrayIcon sti(QIcon(QPixmap::fromImage(img)));
-     sti.show();
+     QApplication a(argc, argv);
+     QImage img(64,64, QImage::Format_ARGB32);
+     img.fill(Qt::red);
+     QSystemTrayIcon sti(QIcon(QPixmap::fromImage(img)));
+     sti.show();
  
-      QSystemTrayIcon::isSystemTrayAvailable(); // with this line, the QSystemTrayIcon does not appear
-      // comment the previous line to see that the QSystemTrayIcon works and that there is a bug in that line
+      QSystemTrayIcon::isSystemTrayAvailable(); // with this line, the QSystemTrayIcon does not appear
+      // comment the previous line to see that the QSystemTrayIcon works and that there is a bug in that line
  
-     return a.exec();
+     return a.exec();
  }
  ```
  
  This testcase shows that the
  AppMenuPlatformSystemTrayIcon::~AppMenuPlatformSystemTrayIcon  called by
  the temporary object created inside
  QSystemTrayIcon::isSystemTrayAvailable unregisters the icon.

-- 
You received this bug notification because you are a member of DX
Packages, which is subscribed to appmenu-qt5 in Ubuntu.
https://bugs.launchpad.net/bugs/1574699

Title:
  All QSystemTrayIcon have the same icon, and
  QSystemTrayIcon::isSystemTrayAvailable remove all QSystemTrayIcon

Status in appmenu-qt5:
  New
Status in appmenu-qt5 package in Ubuntu:
  Fix Released
Status in appmenu-qt5 source package in Xenial:
  In Progress

Bug description:
  # Impact
  This affects all Qt applications that use QSystemTrayIcon::​isSystemTrayAvailable, in Unity environment. Confirmed examples are owncloud-client and keepassxc, but there may be more applications.

  # Test Case
  See the original description below for the test case in C++.

  # Proposed Fix
  The proposed fix is identical to what was uploaded to Yakkety as version 0.3.0+16.10.20160628.1-0ubuntu1. The fix is using unique connections for all AppMenuPlatformSystemTrayIcon instances.

  # Regression Potential
  The fix is in Yakkety since June and in Zesty, and nobody complained so far. So it should not cause any regressions.

  -----------------------------------------------------------------------------
  in appmenu-qt5 in ubuntu 16.04, the  AppMenuPlatformSystemTrayIcon assumes there is only one instance of a QPlatformSystemTrayIcon: it register the same dbus name for all the instances.  In fact, there is one instance of QPlatformSystemTrayIcon per instance of QSystemTrayIcon,  and one temporary is created for QSystemTrayIcon::isSystemTrayAvailable.

  This breaks the owncloud client  [issue
  https://github.com/owncloud/client/issues/4693 ]

  This example reproduces the problem:

  ```
  #include <QtWidgets>

  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      QImage img(64,64, QImage::Format_ARGB32);
      img.fill(Qt::red);
      QSystemTrayIcon sti(QIcon(QPixmap::fromImage(img)));
      sti.show();

       QSystemTrayIcon::isSystemTrayAvailable(); // with this line, the QSystemTrayIcon does not appear
       // comment the previous line to see that the QSystemTrayIcon works and that there is a bug in that line

      return a.exec();
  }
  ```

  This testcase shows that the
  AppMenuPlatformSystemTrayIcon::~AppMenuPlatformSystemTrayIcon  called
  by the temporary object created inside
  QSystemTrayIcon::isSystemTrayAvailable unregisters the icon.

To manage notifications about this bug go to:
https://bugs.launchpad.net/appmenu-qt5/+bug/1574699/+subscriptions