diff --git a/src/core/mainwindow.cpp b/src/core/mainwindow.cpp index c418319c3..636c4bfd0 100644 --- a/src/core/mainwindow.cpp +++ b/src/core/mainwindow.cpp @@ -1507,6 +1507,14 @@ void MainWindow::StopAfterCurrent() { emit StopAfterToggled(app_->playlist_manager()->active()->stop_after_current()); } +void MainWindow::showEvent(QShowEvent *e) { + + hidden_ = false; + + QMainWindow::showEvent(e); + +} + void MainWindow::closeEvent(QCloseEvent *e) { if (!hidden_ && keep_running_ && e->spontaneous() && QSystemTrayIcon::isSystemTrayAvailable()) { @@ -2211,9 +2219,11 @@ void MainWindow::CommandlineOptionsReceived(const quint32 instanceId, const QByt raise(); show(); activateWindow(); + hidden_ = false; } else CommandlineOptionsReceived(options); + } void MainWindow::CommandlineOptionsReceived(const CommandlineOptions &options) { @@ -2713,8 +2723,11 @@ void MainWindow::PlaylistCurrentChanged(const QModelIndex &proxy_current) { } void MainWindow::Raise() { + show(); activateWindow(); + hidden_ = false; + } #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) diff --git a/src/core/mainwindow.h b/src/core/mainwindow.h index 7dde26a4c..1b349fc58 100644 --- a/src/core/mainwindow.h +++ b/src/core/mainwindow.h @@ -114,8 +114,9 @@ class MainWindow : public QMainWindow, public PlatformInterface { void CommandlineOptionsReceived(const CommandlineOptions &options); protected: - void keyPressEvent(QKeyEvent *e) override; + void showEvent(QShowEvent *e) override; void closeEvent(QCloseEvent *e) override; + void keyPressEvent(QKeyEvent *e) override; #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override; #else