Hello community, here is the log from the commit of package cantata for openSUSE:Factory checked in at 2018-02-01 21:30:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cantata (Old) and /work/SRC/openSUSE:Factory/.cantata.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cantata" Thu Feb 1 21:30:53 2018 rev:5 rq:571720 version:2.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/cantata/cantata.changes 2018-01-25 12:41:31.299915395 +0100 +++ /work/SRC/openSUSE:Factory/.cantata.new/cantata.changes 2018-02-01 21:31:45.266432745 +0100 @@ -1,0 +2,7 @@ +Thu Feb 1 15:36:32 UTC 2018 - [email protected] + +- Add upstream patch: fix-prevent-logout.patch to Work-around + Cantata preventing logout under GNOME/KDE if set to minimise + to system tray and main window is open. + +------------------------------------------------------------------- New: ---- fix-prevent-logout.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cantata.spec ++++++ --- /var/tmp/diff_new_pack.u08ha3/_old 2018-02-01 21:31:45.886403741 +0100 +++ /var/tmp/diff_new_pack.u08ha3/_new 2018-02-01 21:31:45.890403554 +0100 @@ -29,6 +29,8 @@ Patch2: install-libsolidlite.diff # PATCH-FIX-UPSTREAM fix-qt-510.pach -- fix crash with Qt 5.10 (boo#1077468) Patch3: fix-qt-510.patch +# PATCH-FIX-UPSTREAM: https://github.com/CDrummond/cantata/issues/1183 +Patch4: fix-prevent-logout.patch #Source0: https://github.com/CDrummond/cantata/archive/v%{version}.tar.gz BuildRequires: fdupes BuildRequires: media-player-info @@ -102,6 +104,7 @@ %patch1 -p0 %patch2 -p0 %patch3 -p1 +%patch4 -p1 %build %cmake ++++++ fix-prevent-logout.patch ++++++ >From 996a9626f3db60b7fff27951dc9ed75e459a0533 Mon Sep 17 00:00:00 2001 From: Craig Drummond <[email protected]> Date: Wed, 31 Jan 2018 18:05:05 +0000 Subject: [PATCH] Work-around Cantata preventing logout under GNOME/KDE if set to minimise to system tray and main window is open. Issue #1183 --- diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index b0ef7418a..99b52f6a3 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -856,6 +856,7 @@ void MainWindow::init() connect(coverWidget, SIGNAL(clicked()), expandInterfaceAction, SLOT(trigger())); #if !defined Q_OS_WIN && !defined Q_OS_MAC connect(MountPoints::self(), SIGNAL(updated()), SLOT(checkMpdAccessibility())); + connect(qApp, SIGNAL(commitDataRequest(QSessionManager&)), SLOT(commitDataRequest(QSessionManager&))); #endif playQueueItemsSelected(false); playQueue->setFocus(); @@ -1090,12 +1091,10 @@ void MainWindow::showEvent(QShowEvent *event) void MainWindow::closeEvent(QCloseEvent *event) { - if (trayItem->isActive() && Settings::self()->minimiseOnClose()) { + if (trayItem->isActive() && Settings::self()->minimiseOnClose() && event->spontaneous()) { lastPos=pos(); hide(); - if (event->spontaneous()) { - event->ignore(); - } + event->ignore(); } else if (canClose()) { QMainWindow::closeEvent(event); } @@ -1273,6 +1272,19 @@ void MainWindow::quit() qApp->quit(); } +void MainWindow::commitDataRequest(QSessionManager &mgr) +{ + Q_UNUSED(mgr) + #if !defined Q_OS_WIN && !defined Q_OS_MAC + if (isVisible() && trayItem->isActive() && Settings::self()->minimiseOnClose()) { + // Issue 1183 If We are using a tray item, and have window open - then cantata intercepts close events + // and hides the window. This seems to prevent the logout dialog appwaring under GNOME Shell. + // To work-around this if qApp emits commitDataRequest and our window is open, them close. + QMainWindow::close(); + } + #endif +} + void MainWindow::checkMpdDir() { #ifdef Q_OS_LINUX diff --git a/gui/mainwindow.h b/gui/mainwindow.h index e9582b075..539741ff5 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -60,6 +60,7 @@ class QPropertyAnimation; class QActionGroup; class QDateTime; class QMenu; +class QSessionManager; class TrayItem; class HttpStream; class MPDStatus; @@ -162,6 +163,7 @@ public Q_SLOTS: void playQueueItemsSelected(bool s); void showPreferencesDialog(const QString &page=QString()); void quit(); + void commitDataRequest(QSessionManager &mgr); void updateSettings(); void toggleOutput(); void changeConnection();
