From 551aae36c45059a15220c48220acc98cbb64701b Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 8 Nov 2022 21:14:12 -0300 Subject: [PATCH] Destroy overlay in ~DraggableWidget destructor There is an issue where we can drag a recent item and load a file (using Alt+F or Ctrl+O) while dragging the recent item. With this commit the overlay is destroyed after the file is open (without this the overlay is kept floating). Probably related to #3504 but we're not sure. --- src/app/ui/draggable_widget.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/ui/draggable_widget.h b/src/app/ui/draggable_widget.h index 1c6e7f74f..19404331f 100644 --- a/src/app/ui/draggable_widget.h +++ b/src/app/ui/draggable_widget.h @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2018-2021 Igara Studio S.A. +// Copyright (C) 2018-2022 Igara Studio S.A. // // This program is distributed under the terms of // the End-User License Agreement for Aseprite. @@ -26,6 +26,11 @@ public: template DraggableWidget(Args...args) : Base(args...) { } + ~DraggableWidget() { + if (m_floatingOverlay) + destroyFloatingOverlay(); + } + bool onProcessMessage(ui::Message* msg) override { switch (msg->type()) {