diff --git a/Documents/Changelog/Changelog.md b/Documents/Changelog/Changelog.md index 5a97c839aa..3bda524ef2 100644 --- a/Documents/Changelog/Changelog.md +++ b/Documents/Changelog/Changelog.md @@ -4,6 +4,7 @@ ## 2026-04-20 - Build 2604 (Version 105-LTS - Patch 2) - April 2026 +* Resolved [#2132](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2132), Drag feedback artifact: when dragging a dockable page, a small dark artefact appeared in the top-left corner of the screen. The drop feedback window (`DropSolidWindow`) was created at (0,0); it is now positioned off-screen initially and when no drop target is matched. * Implemented [#2952](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2962), Set license header via `editorconfig` * Resolved [#2935](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2935), Maximized MDI window form border drawn on wrong monitor (secondary monitor); `DropSolidWindow` now uses screen coordinates for `DesktopBounds`; non-client border painting uses a DC compatible with the window's monitor * Resolved [#2103](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2103), Ensure that `KryptonForm` properly supports RTL/LTR diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackDocking.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackDocking.cs index 4a15c9c7bf..46073d9fdf 100644 --- a/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackDocking.cs +++ b/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackDocking.cs @@ -223,8 +223,9 @@ public override void Start(IPaletteDragDrop paletteDragDrop, if (_solid == null) { // Create and show a solid feedback window without it taking focus + // Position off-screen initially to avoid a visible 1x1 artifact at top-left (0,0). _solid = new DropSolidWindow(PaletteDragDrop, Renderer); - _solid.SetBounds(0, 0, 1, 1, BoundsSpecified.All); + _solid.SetBounds(GlobalStaticValues.OFF_SCREEN_POSITION, GlobalStaticValues.OFF_SCREEN_POSITION, 1, 1, BoundsSpecified.All); _solid.ShowWithoutActivate(); _solid.Refresh(); } diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackSolid.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackSolid.cs index e05339903a..c0b3d8b3f2 100644 --- a/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackSolid.cs +++ b/Source/Krypton Components/Krypton.Navigator/Dragging/DragFeedbackSolid.cs @@ -57,7 +57,9 @@ public override void Start(IPaletteDragDrop paletteDragDrop, { // Create and show a window without it taking focus _solid = new DropSolidWindow(PaletteDragDrop, Renderer); - _solid.SetBounds(0, 0, 1, 1, BoundsSpecified.All); + + // Position off-screen initially to avoid a visible 1x1 artifact at top-left (0,0). + _solid.SetBounds(GlobalStaticValues.OFF_SCREEN_POSITION , GlobalStaticValues.OFF_SCREEN_POSITION, 1, 1, BoundsSpecified.All); _solid.ShowWithoutActivate(); _solid.Refresh(); } diff --git a/Source/Krypton Components/Krypton.Navigator/Dragging/DropSolidWindow.cs b/Source/Krypton Components/Krypton.Navigator/Dragging/DropSolidWindow.cs index 4c8b43e987..f991533d32 100644 --- a/Source/Krypton Components/Krypton.Navigator/Dragging/DropSolidWindow.cs +++ b/Source/Krypton Components/Krypton.Navigator/Dragging/DropSolidWindow.cs @@ -81,9 +81,19 @@ public Rectangle SolidRect { _solidRect = value; - var area = Screen.GetWorkingArea(this); - - var bounds = new Rectangle(value.Location - (Size)area.Location, value.Size); + Rectangle bounds; + + if (value.IsEmpty) + { + // Move off-screen to avoid a visible artifact at (0,0) when no target is matched + bounds = new Rectangle(GlobalStaticValues.OFF_SCREEN_POSITION, GlobalStaticValues.OFF_SCREEN_POSITION, 0, 0); + } + else + { + var area = Screen.GetWorkingArea(this); + + bounds = new Rectangle(value.Location - (Size)area.Location, value.Size); + } DesktopBounds = bounds; diff --git a/Source/Krypton Components/Krypton.Toolkit/General/GlobalStaticValues.cs b/Source/Krypton Components/Krypton.Toolkit/General/GlobalStaticValues.cs index 6f4db9cfcb..082388ee07 100644 --- a/Source/Krypton Components/Krypton.Toolkit/General/GlobalStaticValues.cs +++ b/Source/Krypton Components/Krypton.Toolkit/General/GlobalStaticValues.cs @@ -56,6 +56,9 @@ public class GlobalStaticValues internal const int DEFAULT_PADDING = 10; + /// Windows convention for positioning windows off-screen (e.g. to hide them). Used when placing windows so they are not visible. + public const int OFF_SCREEN_POSITION = -32000; + /// The global default theme index public const int GLOBAL_DEFAULT_THEME_INDEX = (int)PaletteMode.Microsoft365Blue;