From 4e8a12f37339ca9d802ebaba956d69d31653526f Mon Sep 17 00:00:00 2001 From: Jim Broadus Date: Tue, 23 Feb 2021 12:35:14 -0800 Subject: [PATCH] errordialog: Don't clear messages on sponaneous events. Don't clear the message dialog if a hide event is sent from the window manager. These spontaneous events are sent when a window is minimized, moved to a different screen, etc. --- src/widgets/errordialog.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/widgets/errordialog.cpp b/src/widgets/errordialog.cpp index 2a99fabd3..b3f427168 100644 --- a/src/widgets/errordialog.cpp +++ b/src/widgets/errordialog.cpp @@ -17,6 +17,7 @@ #include "errordialog.h" +#include #include #include "ui_errordialog.h" @@ -47,9 +48,11 @@ void ErrorDialog::ShowMessage(const QString& message) { activateWindow(); } -void ErrorDialog::hideEvent(QHideEvent*) { - current_messages_.clear(); - UpdateContent(); +void ErrorDialog::hideEvent(QHideEvent* event) { + if (!event->spontaneous()) { + current_messages_.clear(); + UpdateContent(); + } } void ErrorDialog::UpdateContent() {