diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 30348ca0a..f5d81f185 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -571,6 +571,7 @@ MainWindow::MainWindow(Application* app, SystemTrayIcon* tray_icon, OSD* osd, connect(app_->player(), SIGNAL(Paused()), osd_, SLOT(Paused())); connect(app_->player(), SIGNAL(Stopped()), osd_, SLOT(Stopped())); + connect(app_->player(), SIGNAL(Playing()), osd_, SLOT(ResumedPlayback())); connect(app_->player(), SIGNAL(PlaylistFinished()), osd_, SLOT(PlaylistFinished())); connect(app_->player(), SIGNAL(VolumeChanged(int)), osd_, diff --git a/src/widgets/osd.cpp b/src/widgets/osd.cpp index 2d81eb12f..ba1135166 100644 --- a/src/widgets/osd.cpp +++ b/src/widgets/osd.cpp @@ -50,6 +50,7 @@ OSD::OSD(SystemTrayIcon* tray_icon, Application* app, QObject* parent) preview_mode_(false), force_show_next_(false), ignore_next_stopped_(false), + is_player_paused_(false), pretty_popup_(new OSDPretty(OSDPretty::Mode_Popup)) { connect(app_->current_art_loader(), SIGNAL(ThumbnailLoaded(Song, QString, QImage)), @@ -152,8 +153,18 @@ void OSD::AlbumArtLoaded(const Song& song, const QString& uri, } } +void OSD::ResumedPlayback() { + if (show_on_pause_) { + if (is_player_paused_) { + ReshowCurrentSong(); + } + is_player_paused_ = false; + } +} + void OSD::Paused() { if (show_on_pause_) { + is_player_paused_ = true; ShowMessage(QCoreApplication::applicationName(), tr("Paused")); } } diff --git a/src/widgets/osd.h b/src/widgets/osd.h index 201481a1f..f9071af9c 100644 --- a/src/widgets/osd.h +++ b/src/widgets/osd.h @@ -72,6 +72,7 @@ class OSD : public QObject { void Paused(); void Stopped(); + void ResumedPlayback(); void StopAfterToggle(bool stop); void PlaylistFinished(); void VolumeChanged(int value); @@ -126,6 +127,7 @@ class OSD : public QObject { bool force_show_next_; bool ignore_next_stopped_; + bool is_player_paused_; OSDPretty* pretty_popup_;