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

QSystemTrayIcon (windows 10) QT5.12.4 not working.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 5.12.4
    • None
    • Visual Studio 2019 16.2.1 open source qt windows 10
    • Windows

    Description

      While porting 110 projects from QT5.9.0 to QT5.12.5 (and VC 2019 to 2019) one application which uses QSystemTrayIcon no longer displayed any system tray notification when built with the new Qt version. It worked absolutely fine on windows 7 but when testing in a Windows 10 VM no notification appeared. The same source code built against Qt 5.9.0 worked correctly on all platforms. 

       

      On debugging the call to Shell_NotifyIcon shows a return value (in register eax/rax) of 1 indicating success but no message is ever visible. So yes its certainly platform specific but it worked with 5.9. On checking and comparing sources there are some refactoring here that have taken place although the code is similar. I needed an urgent workaround....

      As an experiment I took the earlier sources for QSystemTrayIcon from QT 5.9, renamed the class to QSystemTrayIcon59 and added these to my project. The application now works correctly on all platforms. 

       

      I conclude that there must be some subtle difference here.

       

      Observations:

      When the call to showMessage is made the application is of course hidden - it is not shown until the balloon is clicked.

       

      It should be possible to create a simple example or (modify if needed) the QSystemTrayIcon sample app. I'd send mine but too many dependencies.

      Possible clues... 

      The NOTIFYICONDATA structure has members uVersion and uTimeout that share the same address (in an anon union). In the Qt code both 5.9.0 and 5.12.4 both members are assigned. In 5.12.4 according to the debugger the 2nd assignment to uTimeout however gets optimised away (and I'm not sure this is even quite correct so maybe bad compiler??). Anyway it's just a possible starting point but further investigation is required. It does seem that this single field in the struct is different at the time of calling Shell_NotifyIcon when comparing 5.9.0 and 5.12.4. 

       

       

       

      May possibly be related to QTBUG-69498

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            bluespider David Hussey
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes