-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hc:Window在全屏显示时,占据面积超出了整个显示器,在双屏时可复现 #1649
Comments
调试模式下是这样的,发布出来的exe就没问题了。你可以试试,我是vs2022,.net 8 |
bro release模式下也是这样的,hc:Window加了个8,8,8,8的padding,搞不懂 |
一个临时解决方案可以参考. #region fields
// ...
private readonly WindowChrome _chrome;
#endregion
#region ctor
// ...
public Window()
{
#if NET40
_chrome = new WindowChrome
{
CornerRadius = new CornerRadius(),
GlassFrameThickness = new Thickness(0, 0, 0, 1)
};
#else
_chrome = new WindowChrome
{
UseAeroCaptionButtons = false
};
if (SystemHelper.GetSystemVersionInfo() < SystemVersionInfo.Windows11_22H2)
{
_chrome.GlassFrameThickness = new Thickness(0, 0, 0, 1);
_chrome.CornerRadius = new CornerRadius();
}
#endif
BindingOperations.SetBinding(_chrome, WindowChrome.CaptionHeightProperty,
new Binding(NonClientAreaHeightProperty.Name) { Source = this });
WindowChrome.SetWindowChrome(this, _chrome);
_commonPadding = Padding;
Loaded += (s, e) => OnLoaded(e);
}
#endregion
protected override void OnStateChanged(EventArgs e)
{
base.OnStateChanged(e);
if (WindowState == WindowState.Maximized)
{
BorderThickness = new Thickness();
_tempNonClientAreaHeight = NonClientAreaHeight;
NonClientAreaHeight += 8;
#if !NET40
_chrome.NonClientFrameEdges = NonClientFrameEdges.Bottom;
#endif
}
else
{
BorderThickness = _actualBorderThickness;
NonClientAreaHeight = _tempNonClientAreaHeight;
#if !NET40
_chrome.NonClientFrameEdges = NonClientFrameEdges.None;
#endif
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
hc:Window在全屏显示时,占据面积超出了整个显示器,在双屏时可复现。
如下图,左边是HandyControlDemo全屏显示且激活在前方;右侧窗口是Everything最大化窗口未激活。
比较明显的看到HandyControlDemo的关闭按钮右侧还有东西,挡住了Everything窗口
Steps to reproduce the bug
打开基于hc:Windows的窗口,最大化在左侧显示器,观察右侧显示
Expected behavior
No response
Screenshots
No response
NuGet package version
HandyControl 3.4.0
IDE
No response
Framework type
No response
Windows version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: