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

Windows 11 dark mode not applied on certain Windows 11 installations

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.0
    • QPA: Windows
    • None
    • Windows

    Description

      My application MKVToolNix uses Qt 6.5.0 with Fusion style on Windows. I've now had several users report that on their installation MKVToolNix was not using the dark palette on startup even though they have Windows 11's app mode set to "dark". I've confirmed with them that the corresponding registry setting HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\AppsUseLightTheme is indeed set to 0.

      Furthermore this isn't a bug in MKVToolNix as it can be reproduced with one of Qt's example applications. I've taken the widgets/lineedits example, added QApplication::setStyle(QString::fromUtf8("Fusion")); in main.cpp before the app is created, and the resulting exe is using the light palette for the affected users (see the attached main.cpp) as well.

      I've confirmed with those users that they don't have any Qt-related environment variables set (e.g. QT_QPA_PLATFORM, QT_QPA_PLATFORMTHEME, QT_STYLE_OVERRIDE are all unset) & that there are no additional command-line options as observed by dumping argv directly in main before creating the QGuiApplication).

      Unfortunately I myself cannot reproduce the behavior on my own Windows 11 22H2 installation: both my own MKVToolNix as well as the lineedits.exe use the dark palette if my Windows 11's app color mode is set to "dark".

      How can I debug this further? What kind of information can I ask my users to provide?

      Attachments

        1. main.cpp
          0.3 kB
        2. Recording_2023-05-11_011820.mp4
          27.28 MB
        3. Recording_2023-05-11_013142.mp4
          4.25 MB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            owolff Oliver Wolff
            mbunkus Moritz Bunkus
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes