| Summary: | Notifications disappear too quickly | ||
|---|---|---|---|
| Product: | [Applications] Discover | Reporter: | Nate Graham <nate> |
| Component: | discover | Assignee: | Aleix Pol <aleixpol> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | bugseforuns, sitter |
| Priority: | NOR | ||
| Version First Reported In: | 5.11.4 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://commits.kde.org/discover/4aebbb7041e5665ca2d5bc8e30e8b38de2643de7 | Version Fixed/Implemented In: | 5.12.1 |
| Sentry Crash Report: | |||
| Attachments: |
Two passiveNotifications on app startup that quickly disappear
One passiveNotification after canceling a password prompt |
||
|
Description
Nate Graham
2017-12-20 18:30:57 UTC
Something seems not quite right, since browsing the code, kirigami's showPassiveNotification() function is supposed to use a timeout of 4500ms by default if no timeout value is specified, and Discover invokes the method without a timeout argument:
QMetaObject::invokeMethod(rootObject(), "showPassiveNotification", Qt::QueuedConnection, Q_ARG(QVariant, msg), Q_ARG(QVariant, {}), Q_ARG(QVariant, {}), Q_ARG(QVariant, {}));
I tried removing the timer wrapping it:
diff --git a/discover/DiscoverMainWindow.cpp b/discover/DiscoverMainWindow.cpp
index 247268f..83436cd 100644
--- a/discover/DiscoverMainWindow.cpp
+++ b/discover/DiscoverMainWindow.cpp
@@ -401,7 +401,5 @@ QWindow* DiscoverMainWindow::rootObject() const
void DiscoverMainWindow::showPassiveNotification(const QString& msg)
{
- QTimer::singleShot(100, this, [this, msg](){
- QMetaObject::invokeMethod(rootObject(), "showPassiveNotification", Qt::QueuedConnection, Q_ARG(QVariant, msg), Q_ARG(QVariant, {}), Q_ARG(QVariant, {}), Q_ARG(QVariant, {}));
- });
+ QMetaObject::invokeMethod(rootObject(), "showPassiveNotification", Qt::QueuedConnection, Q_ARG(QVariant, msg), Q_ARG(QVariant, {}), Q_ARG(QVariant, {}), Q_ARG(QVariant, {}));
}
Then I tried manually specifying a "long" timeout:
diff --git a/discover/DiscoverMainWindow.cpp b/discover/DiscoverMainWindow.cpp
index 247268f..8c46aa2 100644
--- a/discover/DiscoverMainWindow.cpp
+++ b/discover/DiscoverMainWindow.cpp
@@ -401,7 +401,5 @@ QWindow* DiscoverMainWindow::rootObject() const
void DiscoverMainWindow::showPassiveNotification(const QString& msg)
{
- QTimer::singleShot(100, this, [this, msg](){
- QMetaObject::invokeMethod(rootObject(), "showPassiveNotification", Qt::QueuedConnection, Q_ARG(QVariant, msg), Q_ARG(QVariant, {}), Q_ARG(QVariant, {}), Q_ARG(QVariant, {}));
- });
+ QMetaObject::invokeMethod(rootObject(), "showPassiveNotification", Qt::QueuedConnection, Q_ARG(QVariant, msg), Q_ARG(QVariant, QStringLiteral("long")), Q_ARG(QVariant, {}), Q_ARG(QVariant, {}));
}
Both of them just made the notifications disappear almost instantly; it seems like the timeout was always getting set to 0 or something.
It looks like this is an issue in Kirigami not using the correct default timeout or honoring the one we pass it, or in Discover for somehow not calling it correctly. I can get all the other arguments to work properly though. Created attachment 109463 [details]
Two passiveNotifications on app startup that quickly disappear
Created attachment 109464 [details]
One passiveNotification after canceling a password prompt
*** This bug has been marked as a duplicate of bug 388099 *** Are you sure this is the same issue? Even notifications that don't get squashed by others don't seem to last very long and can easily be missed. *** Bug 389457 has been marked as a duplicate of this bug. *** Not the same issue. Even when there aren't two consecutive notifications, they can still disappear before you've had a chance to read them. We should probably require the user to acknowledge and close them (and then make a big push to only show notifications that are clear and actionable). Git commit 4aebbb7041e5665ca2d5bc8e30e8b38de2643de7 by Aleix Pol. Committed on 06/02/2018 at 12:08. Pushed by apol into branch 'Plasma/5.12'. Use the default passive notification amount In practice it's 4500ms which is 33% longer than the previous 3000ms. M +2 -2 discover/qml/DiscoverWindow.qml https://commits.kde.org/discover/4aebbb7041e5665ca2d5bc8e30e8b38de2643de7 |