lepoco / lepoco/wpfui

Exeption thrown when ExtendsContentIntoTitleBar="True" WindowBackdropType="Mica" is added to UI:Window

Open
#531 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
9.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Managed Debugging Assistant 'PInvokeStackImbalance' : 'A call to PInvoke function 'Wpf.Ui!Wpf.Ui.Interop.User32::SetWindowLong' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature

To Reproduce
  1. Create a Wpf project in .net 4.8
  2. add WPFUI nuget package
  3. Change mainWindow to ui:UIwindow
  4. Change mainwindow code behind to inherit from INaviagtionWindow
  5. add ThemesDictionary and Controls Dictionary to Resource dictionary
  6. add ExtendsContentIntoTitleBar="True" to Mainwindow
  7. WindowBackdropType="Mica" to Mainwindow
  8. Dubug the application
Expected behavior

Unbalanced stack exception shouldn't be thrown

Screenshots

No response

OS version

Windows 11 and Windows 10

.NET version

4.8

WPF-UI NuGet version

2.0.3

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Wpf.Ui.Interop.User32::SetWindowLong P/Invoke call implicated by the Managed Debugging Assistant, then reproduce the issue using the listed .NET Framework 4.8, UI:Window, title-bar, and Mica settings. Done means the provided WPF project no longer reports a PInvokeStackImbalance exception while debugging on Windows 10 or 11.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.