Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. I can't achieve the aero effect of windows7 using dwm on windows10
Forum Updated to NodeBB v4.3 + New Features

I can't achieve the aero effect of windows7 using dwm on windows10

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 676 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    QtCaiJi
    wrote on last edited by
    #1

    I want to achieve the effect shown below
    qtwinextras-musicplayer-composited.png

    But I got this effect using the following code

        QtWin::extendFrameIntoClientArea(this,-1,-1,-1,-1);
        setAttribute(Qt::WA_TranslucentBackground,true);
        setAttribute(Qt::WA_NoSystemBackground,false);
        setStyleSheet(QStringLiteral("MainWindow { background: transparent;}"));
    

    14.png

    Is there any way to achieve the glass effect I want?
    thank you !

    1 Reply Last reply
    1
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      There's gonna be a couple roadblocks ahead of you.

      First - there's no Aero in Windows 10 or above. DWM on 10 and 11 uses a different, opaque material by default.
      You can customize the backdrop material, but it's not gonna be easy. The closest to Aero that Windows 10 provides out of the box is Mica (a material with a frosted glass effect over windows desktop) and Acrylic (a material with a frosted glass effect that also blurs all windows below it).

      Unfortunately Microsoft originally provided them only as XAML materials for UWP apps. After tons and tons of complaints from users and a couple years later they made their way into the Windows AppSDK and WINUI3, which are C#, C++/CX or C++/WinRT libraries for Windows 11 app development. See here for details. Due to their massive massive intrusiveness this is not a feasible route for Qt apps I would say.

      After even more complaints and even more years later they were finally exposed to Win32 apps (which is what a Qt app on Windows is at its core). It's still not a straightforward process and requires a compositor and still intrusive (although not so much as above) modifications to the basic Window setup. See here for details.

      A final two hurdles to overcome are that Qt6 dropped the QtWin extras module, so no DWM interaction is provided by Qt anymore. Also the Qt::WA_TranslucentBackground flag in Qt 6 requires you to make the window frameless for some reason. There's no such requirement in WinAPI, and it did work in Qt5, so I consider this a documented regression and very annoying. If you set it on a normal window you will get a black opaque background with no alpha channel that doesn't compose with the Mica or Acrylic material underneath.

      All very very frustrating developments. I've been watching this space since Aero days and honestly with each new windows SDK and Windows AppSDK release it's a mess after mess. You can't even get a simple Dark/Light value from that garbage for the current system theme. So in summary - it's probably possible if you stick to Qt5, and are ready to make some very platform dependent modifications to the core window setup with a bunch of winId() hacking, but it's a road of hurt.

      RokeJulianLockhartR 1 Reply Last reply
      3
      • Chris KawaC Chris Kawa

        There's gonna be a couple roadblocks ahead of you.

        First - there's no Aero in Windows 10 or above. DWM on 10 and 11 uses a different, opaque material by default.
        You can customize the backdrop material, but it's not gonna be easy. The closest to Aero that Windows 10 provides out of the box is Mica (a material with a frosted glass effect over windows desktop) and Acrylic (a material with a frosted glass effect that also blurs all windows below it).

        Unfortunately Microsoft originally provided them only as XAML materials for UWP apps. After tons and tons of complaints from users and a couple years later they made their way into the Windows AppSDK and WINUI3, which are C#, C++/CX or C++/WinRT libraries for Windows 11 app development. See here for details. Due to their massive massive intrusiveness this is not a feasible route for Qt apps I would say.

        After even more complaints and even more years later they were finally exposed to Win32 apps (which is what a Qt app on Windows is at its core). It's still not a straightforward process and requires a compositor and still intrusive (although not so much as above) modifications to the basic Window setup. See here for details.

        A final two hurdles to overcome are that Qt6 dropped the QtWin extras module, so no DWM interaction is provided by Qt anymore. Also the Qt::WA_TranslucentBackground flag in Qt 6 requires you to make the window frameless for some reason. There's no such requirement in WinAPI, and it did work in Qt5, so I consider this a documented regression and very annoying. If you set it on a normal window you will get a black opaque background with no alpha channel that doesn't compose with the Mica or Acrylic material underneath.

        All very very frustrating developments. I've been watching this space since Aero days and honestly with each new windows SDK and Windows AppSDK release it's a mess after mess. You can't even get a simple Dark/Light value from that garbage for the current system theme. So in summary - it's probably possible if you stick to Qt5, and are ready to make some very platform dependent modifications to the core window setup with a bunch of winId() hacking, but it's a road of hurt.

        RokeJulianLockhartR Offline
        RokeJulianLockhartR Offline
        RokeJulianLockhart
        wrote on last edited by
        #3

        Unfortunately Microsoft originally provided them only as XAML materials for UWP apps. After tons and tons of complaints from users and a couple years later they made their way into the Windows AppSDK and WINUI3, which are C#, C++/CX or C++/WinRT libraries for Windows 11 app development.

        @Chris-Kawa, there is FluentWinUI3, now. Does it support Mica?

        When using a forum, remember to tag the person you are responding to, in case they are not subscribed to the thread.

        Chris KawaC 1 Reply Last reply
        0
        • RokeJulianLockhartR RokeJulianLockhart

          Unfortunately Microsoft originally provided them only as XAML materials for UWP apps. After tons and tons of complaints from users and a couple years later they made their way into the Windows AppSDK and WINUI3, which are C#, C++/CX or C++/WinRT libraries for Windows 11 app development.

          @Chris-Kawa, there is FluentWinUI3, now. Does it support Mica?

          Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @RokeJulianLockhart AFAIK no. From the doc you linked:

          The FluentWinUI3 style is not a native style and can be run on all supported platforms

          From what I can see it only styles the controls to follow the Fluent guidelines to some degree. It does not use the materials I mentioned or the composition API. I wouldn't hold my breath for that to be honest. Qt and WinUI3 are very different stacks of technologies and they don't mix well, so I wouldn't expect a direct support for that.

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved