Windows 0.2.22 clean UI-maintenance source delta; no private history or other platform changes
This commit is contained in:
@@ -15,6 +15,7 @@ internal sealed class WindowChrome : IDisposable
|
||||
private readonly Form _form;
|
||||
private readonly Panel _header;
|
||||
private readonly Action _requestExit;
|
||||
private readonly Action _minimize;
|
||||
private readonly ToolTip _toolTip = new();
|
||||
private readonly ChromeFormWindow _window;
|
||||
private readonly Dictionary<Control, ChromeChildWindow> _children = new();
|
||||
@@ -27,11 +28,12 @@ internal sealed class WindowChrome : IDisposable
|
||||
|
||||
internal CaptionButton MinimizeButton { get; } = new(CaptionAction.Minimize);
|
||||
|
||||
internal WindowChrome(Form form, Panel header, Action requestExit)
|
||||
internal WindowChrome(Form form, Panel header, Action requestExit, Action? minimize = null)
|
||||
{
|
||||
_form = form;
|
||||
_header = header;
|
||||
_requestExit = requestExit;
|
||||
_minimize = minimize ?? (() => _form.WindowState = FormWindowState.Minimized);
|
||||
_window = new ChromeFormWindow(this);
|
||||
// Managed geometry must see a client-only form. Leaving Sizable here
|
||||
// makes WinForms add the removed caption dimensions again on restore.
|
||||
@@ -88,7 +90,7 @@ internal sealed class WindowChrome : IDisposable
|
||||
if (generation != _handleGeneration || modeGeneration != _modeGeneration) return;
|
||||
_minimizePending = false;
|
||||
if (LoginMode || _disposed || _form.IsDisposed || _form.Disposing || !_form.IsHandleCreated) return;
|
||||
_form.WindowState = FormWindowState.Minimized;
|
||||
_minimize();
|
||||
});
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
@@ -317,7 +319,11 @@ internal sealed class WindowChrome : IDisposable
|
||||
if (ChromeNative.GetMonitorInfo(monitor, ref info))
|
||||
Marshal.StructureToPtr(info.Work, m.LParam, false);
|
||||
}
|
||||
m.Result = IntPtr.Zero;
|
||||
// The client-owned header spans the resized window. Retaining
|
||||
// the old client bits leaves the newly exposed header strip
|
||||
// unpainted on some DWM/scaling paths. Repaint the complete
|
||||
// client after a valid NCCALCSIZE sizing transaction.
|
||||
m.Result = m.WParam != IntPtr.Zero ? (IntPtr)0x300 /* WVR_REDRAW */ : IntPtr.Zero;
|
||||
return;
|
||||
}
|
||||
if (m.Msg == ChromeNative.WmNcHitTest)
|
||||
|
||||
Reference in New Issue
Block a user