Don't ignore closeevent if already hidden

Possible fix for #277
This commit is contained in:
Jonas Kvinge
2020-09-22 18:40:37 +02:00
parent 51ce674c97
commit 204508478f
2 changed files with 34 additions and 30 deletions

View File

@@ -114,8 +114,8 @@ class MainWindow : public QMainWindow, public PlatformInterface {
void CommandlineOptionsReceived(const CommandlineOptions &options);
protected:
void keyPressEvent(QKeyEvent *event) override;
void closeEvent(QCloseEvent *event) override;
void keyPressEvent(QKeyEvent *e) override;
void closeEvent(QCloseEvent *e) override;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
#else
@@ -368,15 +368,18 @@ class MainWindow : public QMainWindow, public PlatformInterface {
QTimer *track_slider_timer_;
QSettings settings_;
bool initialized_;
bool was_maximized_;
bool was_minimized_;
bool keep_running_;
bool playing_widget_;
BehaviourSettingsPage::AddBehaviour doubleclick_addmode_;
BehaviourSettingsPage::PlayBehaviour doubleclick_playmode_;
BehaviourSettingsPage::PlaylistAddBehaviour doubleclick_playlist_addmode_;
BehaviourSettingsPage::PlayBehaviour menu_playmode_;
bool initialized_;
bool was_maximized_;
bool was_minimized_;
bool hidden_;
Song song_;
Song song_playing_;
QImage image_original_;