Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-63447

QSystemTrayIcon blurry icon on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.9.4
    • 5.7.1, 5.9.1
    • None
    • Windows 7 64bit,
      msvc2017: Qt 5.9.1 64bit + Qt 5.7.1 32bit
      mingw 7.1.0: Qt 5.9.1 32bit
    • 92c61b11c1704450adfa3a8ac839478c0f3dd19d (qtbase/5.9, 6.11.2017, 5.9.4)

      The tray icon on Windows is AFAIK 16x16 pixels on a standard DPI monitor. However, if an svg is given or an icon with multiple size, Qt chooses 32x32 pixel size. Then Windows downscales it and the icon becomes blurry. 

      IIRC correctly I didn't encounter this with Qt 5.6.

      I did some digging and it appears that commit "QSystemTrayIcon/Windows: Use large icon for balloon message." b465fe759695bb7e1de693c3d4d20acfd2c49779 https://codereview.qt-project.org/#/c/160784/ caused this.
      The commit message says that its purpose was to facilitate bigger icons in the balloon message. However, it touched code inside QSystemTrayIconSys::createIcon() which is responsible for the tray icon only. (at least on the current version of the file)

      I assume that it shouldn't inquire about SM_CXICON metrics in that place. As far as I am able to see, icon for the balloon is created by the icon given in QSystemTrayIconSys::showMessage() (the variant that takes QIcon). Inside there it does again inquire about the metrics which is totally fine.

      Forgive me if I am wrong. I read the code online on the git repo. So I may have missed something. I didn't have the time to compile Qt and confirm my suspicion.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kleint Friedemann Kleint
            sledgehammer999 sledgehammer999
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes