Skip to content

Reset DWMWA_USE_IMMERSIVE_DARK_MODE to false in clear_mica()#200

Open
XueshiQiao wants to merge 4 commits intotauri-apps:devfrom
XueshiQiao:dev
Open

Reset DWMWA_USE_IMMERSIVE_DARK_MODE to false in clear_mica()#200
XueshiQiao wants to merge 4 commits intotauri-apps:devfrom
XueshiQiao:dev

Conversation

@XueshiQiao
Copy link
Copy Markdown

ref: https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute

DWMWA_USE_IMMERSIVE_DARK_MODE
Use with DwmSetWindowAttribute. Allows the window frame for this window to be drawn in dark mode colors when the dark mode system setting is enabled. For compatibility reasons, all windows default to light mode regardless of the system setting. The pvAttribute parameter points to a value of type BOOL. TRUE to honor dark mode for the window, FALSE to always use light mode.

This value is supported starting with Windows 11 Build 22000.

"For compatibility reasons, all windows default to light mode regardless of the system setting"

So i think we should reset to default mode in clear_mica()
And it performs well when switching theme(dark->light, or light->dark) in tauri applications, it performs weird without the reset operation.

@FabianLars FabianLars requested a review from amrbashir February 15, 2026 13:09
Copy link
Copy Markdown
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can you add a change file .changes directory?

Reset the DWMWA_USE_IMMERSIVE_DARK_MODE flag to false in the clear_mica function.
@XueshiQiao
Copy link
Copy Markdown
Author

LGTM, can you add a change file .changes directory?

I've add one, could you please check it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants