Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/Native/Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

using Avalonia;
using Avalonia.Controls;
using Avalonia.Threading;

namespace SourceGit.Native
{
Expand Down Expand Up @@ -214,12 +215,17 @@ public void OpenWithDefaultEditor(string file)

private void FixWindowFrameOnWin10(Window w)
{
var platformHandle = w.TryGetPlatformHandle();
if (platformHandle == null)
return;
// Schedule the DWM frame extension to run in the next render frame
// to ensure proper timing with the window initialization sequence
Dispatcher.UIThread.InvokeAsync(() =>
{
var platformHandle = w.TryGetPlatformHandle();
if (platformHandle == null)
return;

var margins = new MARGINS { cxLeftWidth = 1, cxRightWidth = 1, cyTopHeight = 1, cyBottomHeight = 1 };
DwmExtendFrameIntoClientArea(platformHandle.Handle, ref margins);
var margins = new MARGINS { cxLeftWidth = 1, cxRightWidth = 1, cyTopHeight = 1, cyBottomHeight = 1 };
DwmExtendFrameIntoClientArea(platformHandle.Handle, ref margins);
}, DispatcherPriority.Render);
}

#region EXTERNAL_EDITOR_FINDER
Expand Down
Loading