Skip to content

Fix PlaceAbove z-order positioning#3

Merged
SteffenCarlsen merged 2 commits into
mainfrom
feature/fix-place-above-z-order
Jun 1, 2026
Merged

Fix PlaceAbove z-order positioning#3
SteffenCarlsen merged 2 commits into
mainfrom
feature/fix-place-above-z-order

Conversation

@SteffenCarlsen

Copy link
Copy Markdown
Owner

Fixes Win32WindowZOrder.PlaceAbove so the positioned window is placed immediately above the relative target instead of behind it. Adds a Windows integration regression test. Validation: dotnet test tests\ModernOverlay.Tests\ModernOverlay.Tests.csproj --configuration Debug --filter PlaceAbovePositionsWindowImmediatelyAboveRelativeWindow.

Copilot AI review requested due to automatic review settings June 1, 2026 12:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Win32WindowZOrder.PlaceAbove so that the moved window ends up immediately above the relative target window (instead of being positioned behind it), and adds a Windows integration regression test to lock the behavior in.

Changes:

  • Update Win32WindowZOrder.PlaceAbove to compute the correct hWndInsertAfter using GW_HWNDPREV.
  • Add a Windows integration regression test validating adjacency in the z-order chain.
  • Introduce NativeMethods.HwndTop to represent HWND_TOP for SetWindowPos.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/ModernOverlay.Tests/Win32StyleTests.cs Adds a Windows integration regression test asserting PlaceAbove positions the overlay immediately above the target.
src/ModernOverlay.Win32/Win32WindowZOrder.cs Fixes PlaceAbove by using the target’s previous window (via GetWindow(..., GW_HWNDPREV)) as the insertion point.
src/ModernOverlay.Win32/NativeMethods.cs Adds HwndTop constant for use with SetWindowPos insertion semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ModernOverlay.Win32/Win32WindowZOrder.cs
@SteffenCarlsen SteffenCarlsen merged commit de0dc46 into main Jun 1, 2026
1 check passed
@SteffenCarlsen SteffenCarlsen deleted the feature/fix-place-above-z-order branch June 1, 2026 13:14
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.

2 participants