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.
This commit is contained in:
Jim Broadus 2021-02-23 12:35:14 -08:00 committed by John Maguire
parent b989a674a4
commit 4e8a12f373
1 changed files with 6 additions and 3 deletions

View File

@ -17,6 +17,7 @@
#include "errordialog.h"
#include <QHideEvent>
#include <QStyle>
#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() {