do not allow toast notifications on wayland - #1494
This commit is contained in:
parent
8d447e2ff8
commit
2fc8cf1e25
@ -118,7 +118,7 @@ void LibMpvWidget::initializeGL() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(QT_FEATURE_wayland)
|
#if defined(QT_FEATURE_wayland)
|
||||||
if (QGuiApplication::platformName() == QStringLiteral("wayland")) {
|
if (qApp->isWayland()) {
|
||||||
display.type = MPV_RENDER_PARAM_WL_DISPLAY;
|
display.type = MPV_RENDER_PARAM_WL_DISPLAY;
|
||||||
display.data = qApp->nativeInterface<QNativeInterface::QWaylandApplication>()->display();
|
display.data = qApp->nativeInterface<QNativeInterface::QWaylandApplication>()->display();
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ BaseToastNotification::BaseToastNotification(QWidget* parent) : QDialog(parent),
|
|||||||
setAttribute(Qt::WidgetAttribute::WA_DeleteOnClose, false);
|
setAttribute(Qt::WidgetAttribute::WA_DeleteOnClose, false);
|
||||||
|
|
||||||
setWindowFlags(
|
setWindowFlags(
|
||||||
#ifdef Q_OS_MAC
|
#if defined(Q_OS_MAC)
|
||||||
Qt::WindowType::SubWindow |
|
Qt::WindowType::SubWindow |
|
||||||
#else
|
#else
|
||||||
Qt::WindowType::Tool |
|
Qt::WindowType::Tool |
|
||||||
|
@ -65,8 +65,18 @@ void SettingsNotifications::loadSettings() {
|
|||||||
->setChecked(settings()->value(GROUP(GUI), SETTING(GUI::EnableNotifications)).toBool());
|
->setChecked(settings()->value(GROUP(GUI), SETTING(GUI::EnableNotifications)).toBool());
|
||||||
m_ui.m_editor->loadNotifications(qApp->notifications()->allNotifications());
|
m_ui.m_editor->loadNotifications(qApp->notifications()->allNotifications());
|
||||||
|
|
||||||
m_ui.m_rbNativeNotifications
|
if (qApp->isWayland()) {
|
||||||
->setChecked(!settings()->value(GROUP(GUI), SETTING(GUI::UseToastNotifications)).toBool());
|
// Wayland does not support fancy notifications, only system ones.
|
||||||
|
m_ui.m_rbNativeNotifications->setChecked(true);
|
||||||
|
m_ui.m_rbCustomNotifications->setEnabled(false);
|
||||||
|
m_ui.m_rbCustomNotifications
|
||||||
|
->setText(tr("%1 (not supported on Wayland)").arg(m_ui.m_rbCustomNotifications->text()));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_ui.m_rbNativeNotifications
|
||||||
|
->setChecked(!settings()->value(GROUP(GUI), SETTING(GUI::UseToastNotifications)).toBool());
|
||||||
|
}
|
||||||
|
|
||||||
m_ui.m_sbScreen->setValue(settings()->value(GROUP(GUI), SETTING(GUI::ToastNotificationsScreen)).toInt());
|
m_ui.m_sbScreen->setValue(settings()->value(GROUP(GUI), SETTING(GUI::ToastNotificationsScreen)).toInt());
|
||||||
m_ui.m_sbWidth->setValue(settings()->value(GROUP(GUI), SETTING(GUI::ToastNotificationsWidth)).toInt());
|
m_ui.m_sbWidth->setValue(settings()->value(GROUP(GUI), SETTING(GUI::ToastNotificationsWidth)).toInt());
|
||||||
m_ui.m_sbMargin->setValue(settings()->value(GROUP(GUI), SETTING(GUI::ToastNotificationsMargin)).toInt());
|
m_ui.m_sbMargin->setValue(settings()->value(GROUP(GUI), SETTING(GUI::ToastNotificationsMargin)).toInt());
|
||||||
|
@ -153,9 +153,8 @@ Application::Application(const QString& id, int& argc, char** argv, const QStrin
|
|||||||
m_database = new DatabaseFactory(this);
|
m_database = new DatabaseFactory(this);
|
||||||
m_downloadManager = nullptr;
|
m_downloadManager = nullptr;
|
||||||
m_notifications = new NotificationFactory(this);
|
m_notifications = new NotificationFactory(this);
|
||||||
m_toastNotifications = settings()->value(GROUP(GUI), SETTING(GUI::UseToastNotifications)).toBool()
|
m_toastNotifications =
|
||||||
? new ToastNotificationsManager(this)
|
(!isWayland() && m_notifications->useToastNotifications()) ? new ToastNotificationsManager(this) : nullptr;
|
||||||
: nullptr;
|
|
||||||
m_shouldRestart = false;
|
m_shouldRestart = false;
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
@ -301,6 +300,7 @@ Application::Application(const QString& id, int& argc, char** argv, const QStrin
|
|||||||
|
|
||||||
setupWorkHorsePool();
|
setupWorkHorsePool();
|
||||||
|
|
||||||
|
qDebugNN << LOGSEC_CORE << "Platform:" << QUOTE_W_SPACE_DOT(QGuiApplication::platformName());
|
||||||
qDebugNN << LOGSEC_CORE << "SQLite version:" << QUOTE_W_SPACE_DOT(SQLITE_VERSION);
|
qDebugNN << LOGSEC_CORE << "SQLite version:" << QUOTE_W_SPACE_DOT(SQLITE_VERSION);
|
||||||
qDebugNN << LOGSEC_CORE << "OpenSSL version:" << QUOTE_W_SPACE_DOT(QSslSocket::sslLibraryVersionString());
|
qDebugNN << LOGSEC_CORE << "OpenSSL version:" << QUOTE_W_SPACE_DOT(QSslSocket::sslLibraryVersionString());
|
||||||
qDebugNN << LOGSEC_CORE << "OpenSSL supported:" << QUOTE_W_SPACE_DOT(QSslSocket::supportsSsl());
|
qDebugNN << LOGSEC_CORE << "OpenSSL supported:" << QUOTE_W_SPACE_DOT(QSslSocket::supportsSsl());
|
||||||
@ -867,6 +867,10 @@ bool Application::usingLite() const {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Application::isWayland() const {
|
||||||
|
return QGuiApplication::platformName() == QSL("wayland");
|
||||||
|
}
|
||||||
|
|
||||||
void Application::onCommitData(QSessionManager& manager) {
|
void Application::onCommitData(QSessionManager& manager) {
|
||||||
qDebugNN << LOGSEC_CORE << "OS asked application to commit its data.";
|
qDebugNN << LOGSEC_CORE << "OS asked application to commit its data.";
|
||||||
|
|
||||||
|
@ -187,6 +187,7 @@ class RSSGUARD_DLLSPEC Application : public SingleApplication {
|
|||||||
WebViewer* createWebView();
|
WebViewer* createWebView();
|
||||||
|
|
||||||
bool usingLite() const;
|
bool usingLite() const;
|
||||||
|
bool isWayland() const;
|
||||||
|
|
||||||
#if defined(NO_LITE)
|
#if defined(NO_LITE)
|
||||||
bool forcedLite() const;
|
bool forcedLite() const;
|
||||||
|
@ -20,7 +20,7 @@ bool NotificationFactory::areNotificationsEnabled() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool NotificationFactory::useToastNotifications() const {
|
bool NotificationFactory::useToastNotifications() const {
|
||||||
return qApp->settings()->value(GROUP(GUI), SETTING(GUI::EnableNotifications)).toBool();
|
return qApp->settings()->value(GROUP(GUI), SETTING(GUI::UseToastNotifications)).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
Notification NotificationFactory::notificationForEvent(Notification::Event event) const {
|
Notification NotificationFactory::notificationForEvent(Notification::Event event) const {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user