mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -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,26 +73,21 @@ 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) =>
|
|
||||||
{
|
|
||||||
if (w.WindowState != WindowState.Maximized)
|
|
||||||
{
|
|
||||||
var margins = new MARGINS { cxLeftWidth = 1, cxRightWidth = 1, cyTopHeight = 1, cyBottomHeight = 1 };
|
|
||||||
DwmExtendFrameIntoClientArea(w.TryGetPlatformHandle().Handle, ref margins);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ExtendWindowFrame(Window w)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
public string FindGitExecutable()
|
public string FindGitExecutable()
|
||||||
{
|
{
|
||||||
var reg = Microsoft.Win32.RegistryKey.OpenBaseKey(
|
var reg = Microsoft.Win32.RegistryKey.OpenBaseKey(
|
||||||
|
|
Loading…
Reference in a new issue