Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:wolfi323:KDE:Extra
cantata
fix-prevent-logout.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-prevent-logout.patch of Package cantata
From 996a9626f3db60b7fff27951dc9ed75e459a0533 Mon Sep 17 00:00:00 2001 From: Craig Drummond <craig.p.drummond@gmail.com> 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();
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor