Agent skill
desktop-shell-maximized-content-inset
Prevent maximize-only clipping in a custom WPF shell by insetting hosted content at the native boundary
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/desktop-shell-maximized-content-inset
SKILL.md
Context
Use this when a WPF desktop shell owns custom chrome (WindowStyle=None / WindowChrome) and hosted content such as WebView2 looks correct in restored mode but loses accents or edge content when maximized.
Pattern
- Treat maximize-only edge clipping as a host-boundary issue first, not a web-layout bug.
- Name the hosted content container separately from the native titlebar/container chrome.
- On maximize, inset that hosted content container by
SystemParameters.WindowResizeBorderThicknesson the clipped edges. - If the native titlebar already owns the top chrome, keep the top inset at zero so you do not create a second gap under the separator.
- On restore, return the inset to zero so restored spacing stays identical.
- Keep the titlebar row independent if you want maximize padding only for hosted content.
Why
The maximized resize frame can overlap the client area in custom-chrome shells. A host-side inset respects the native boundary without forcing the web app to carry maximize-state CSS hacks.
Example
ShellContentHost.Margin = WindowState == WindowState.Maximized ? new Thickness(left, 0, right, bottom) : new Thickness(0);
Anti-Patterns
- Fixing a maximize-only host clipping bug by changing only the active-tab CSS
- Adding permanent padding that alters restored-mode spacing
- Insetting the whole window blindly when only the hosted content needs protection
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?