From 492aea166ef2bd48630cc3b0184cb03bbc34486a Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 22 Mar 2026 14:16:36 -0500 Subject: [PATCH] main dragout: track drag operation, keep cursor drag enter was triggering once the mouse moved, resetting to hand -- not anymore. --- PKHeX.WinForms/MainWindow/Main.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PKHeX.WinForms/MainWindow/Main.cs b/PKHeX.WinForms/MainWindow/Main.cs index be874b389..7695ee824 100644 --- a/PKHeX.WinForms/MainWindow/Main.cs +++ b/PKHeX.WinForms/MainWindow/Main.cs @@ -1209,6 +1209,8 @@ private void Main_DragDrop(object? sender, DragEventArgs? e) e.Effect = DragDropEffects.Copy; } + private bool mainDragOutActive; + // ReSharper disable once AsyncVoidMethod private async void Dragout_MouseDown(object sender, MouseEventArgs e) { @@ -1238,6 +1240,7 @@ private async void Dragout_MouseDown(object sender, MouseEventArgs e) { await File.WriteAllBytesAsync(newfile, data).ConfigureAwait(true); + mainDragOutActive = true; var pb = (PictureBox)sender; if (pb.Image is Bitmap img) C_SAV.M.Drag.SetOwnedCursor(pb, img); @@ -1249,6 +1252,7 @@ private async void Dragout_MouseDown(object sender, MouseEventArgs e) { WinFormsUtil.Error("Drag && Drop Error", x); } finally { + mainDragOutActive = false; C_SAV.M.Drag.ResetCursor(this); await DeleteAsync(newfile, 20_000).ConfigureAwait(false); } @@ -1275,13 +1279,14 @@ private static async Task DeleteAsync(string path, int delay) private void DragoutEnter(object sender, EventArgs e) { dragout.BackgroundImage = PKME_Tabs.Entity.Species > 0 ? SpriteUtil.Spriter.Set : SpriteUtil.Spriter.Delete; - Cursor = Cursors.Hand; + if (!mainDragOutActive) + Cursor = Cursors.Hand; } private void DragoutLeave(object sender, EventArgs e) { dragout.BackgroundImage = SpriteUtil.Spriter.Transparent; - if (Cursor == Cursors.Hand) + if (!mainDragOutActive && Cursor == Cursors.Hand) Cursor = Cursors.Default; }