Skip to content

Conversation

Copy link

Copilot AI commented Dec 29, 2025

Windows 11 automatically deactivates window backdrop effects (Mica/Acrylic) when a window loses focus, turning them gray. This adds a property to override that behavior.

Changes

  • New property: WindowOption.IsBackdropAlwaysActive (default: false)

    • Uses DWMWA_SYSTEMBACKDROP_ALWAYS_ACTIVE attribute (Windows 11 22621+)
    • Follows existing property patterns for event handler management
  • Test windows: Added BackdropAlwaysActiveTestWindow and BackdropNormalTestWindow to demonstrate the behavior difference

Usage

<Window xmlns:ws="https://schemas.elecho.dev/wpfsuite"
        ws:WindowOption.Backdrop="Acrylic"
        ws:WindowOption.IsBackdropAlwaysActive="True"
        Background="Transparent">
    <!-- Backdrop remains active when window loses focus -->
</Window>
Original prompt

This section details on the original issue you should resolve

<issue_title>当窗体失去焦点时,窗体的BackDrop不起作用。</issue_title>
<issue_description>当设置窗体的BakcDrop属性后,窗体变得很漂亮。但当窗体失去焦点时,窗体的背景就便会简单的“灰白”色了,不再有Acrylic等效果。
请问该如何解决这个问题?</issue_description>

<agent_instructions>新增一个属性让用户可以用于控制是否失去焦点时backdrop不生效</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits December 29, 2025 14:26
… window loses focus

Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
…ctiveChanged

Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Copilot AI changed the title [WIP] Add property to control backdrop on form blur Add IsBackdropAlwaysActive property to control backdrop behavior on focus loss Dec 29, 2025
Copilot AI requested a review from emako December 29, 2025 14:37
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.

当窗体失去焦点时,窗体的BackDrop不起作用。

2 participants