mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
fix: Fixed the problem that the AvaloniaRider plugin on Windows cannot display the live preview for Avalonia XAML
This commit is contained in:
parent
f3f39ac593
commit
c0b13bdc8c
1 changed files with 12 additions and 17 deletions
|
@ -73,24 +73,19 @@ namespace SourceGit.Native
|
||||||
v.dwOSVersionInfoSize = (uint)Marshal.SizeOf<RTL_OSVERSIONINFOEX>();
|
v.dwOSVersionInfoSize = (uint)Marshal.SizeOf<RTL_OSVERSIONINFOEX>();
|
||||||
if (RtlGetVersion(ref v) == 0 && (v.dwMajorVersion < 10 || v.dwBuildNumber < 22000))
|
if (RtlGetVersion(ref v) == 0 && (v.dwMajorVersion < 10 || v.dwBuildNumber < 22000))
|
||||||
{
|
{
|
||||||
Window.WindowStateProperty.Changed.AddClassHandler<Window>((w, e) =>
|
Window.WindowStateProperty.Changed.AddClassHandler<Window>((w, e) => ExtendWindowFrame(w));
|
||||||
{
|
Window.LoadedEvent.AddClassHandler<Window>((w, e) => ExtendWindowFrame(w));
|
||||||
if (w.WindowState != WindowState.Maximized)
|
}
|
||||||
{
|
|
||||||
var margins = new MARGINS { cxLeftWidth = 1, cxRightWidth = 1, cyTopHeight = 1, cyBottomHeight = 1 };
|
|
||||||
DwmExtendFrameIntoClientArea(w.TryGetPlatformHandle().Handle, ref margins);
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
Window.LoadedEvent.AddClassHandler<Window>((w, e) =>
|
private void ExtendWindowFrame(Window w)
|
||||||
{
|
|
||||||
if (w.WindowState != WindowState.Maximized)
|
|
||||||
{
|
{
|
||||||
|
var platformHandle = w.TryGetPlatformHandle();
|
||||||
|
if (platformHandle == null)
|
||||||
|
return;
|
||||||
|
|
||||||
var margins = new MARGINS { cxLeftWidth = 1, cxRightWidth = 1, cyTopHeight = 1, cyBottomHeight = 1 };
|
var margins = new MARGINS { cxLeftWidth = 1, cxRightWidth = 1, cyTopHeight = 1, cyBottomHeight = 1 };
|
||||||
DwmExtendFrameIntoClientArea(w.TryGetPlatformHandle().Handle, ref margins);
|
DwmExtendFrameIntoClientArea(platformHandle.Handle, ref margins);
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string FindGitExecutable()
|
public string FindGitExecutable()
|
||||||
|
|
Loading…
Reference in a new issue