Skip to content

Avalonia: Fix transparent strip on right/bottom edges of Avalonia window#4830

Merged
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
Avalonia-transparent-border
May 26, 2026
Merged

Avalonia: Fix transparent strip on right/bottom edges of Avalonia window#4830
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
Avalonia-transparent-border

Conversation

@GabrielDuf
Copy link
Copy Markdown
Contributor

This pull request improves the window styling and native integration for the main window on Windows, focusing on more consistent and modern border handling and fixing layout issues when changing window styles. The most important changes are grouped below.

Window Styling and Layout Consistency:

  • Updated the DataGridRow style in Styles.Common.axaml to always reserve space for the border with a permanent transparent border, preventing layout shifts when selecting rows. The accent border is now never clipped on the first/last rows.

Native Window Handling Enhancements:

  • Added several new Win32 constants and the SetWindowPos P/Invoke to MainWindow.axaml.cs to support more advanced window style and layout changes.
  • After updating the window style, now explicitly calls SetWindowPos with SWP_FRAMECHANGED and related flags to trigger a WM_NCCALCSIZE message, ensuring the window's non-client area is recalculated immediately.
  • Hooks the WM_NCCALCSIZE message in the window procedure to force the client area to occupy the full window rect, eliminating unwanted glass borders from the WS_THICKFRAME style and ensuring a consistent look.

@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit 258dfba into main May 26, 2026
3 checks passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the Avalonia-transparent-border branch May 26, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants