The inhibition handling (e.g. combining time-based, screen mirrored, etc) is done inside the applet.
The Server knows nothing about it and only reports Inhibited as true when an external application requested one, not when the user enabled it in the applet.
This patch exposes the NotificationManager.Server as singleton QML type and adds a way for the applet to tell it the effective inhibition state.
Exposing the server to QML could also be used in the future to provide better error reporting to the user when the service isn't running and/or owned by someone else (e.g. Dunst)
Details
Details
- Reviewers
dfaure davidedmundson - Group Reviewers
Plasma - Commits
- R120:bb0e4208c86c: [Notifications] Report effective Inhibited state on DBus
Would be lovely to get that into 5.17 still
@dfaure asked how apps can check do not disturb mode, turns out it was a bit broken
- Requested external inhibition, applet went into dnd mode, checked dbus to see that change signal was emitted and property returned true
- Killed external app, applet went normal, checked dbus to see that change signal was emitted and property returned false
- Chose "1 hour" in applet, checked dbus to see that change signal was emitted and property
- Started external app, nothing changed because there was already an inhibition
- Unchecked dnd checkbox (which will force dnd off no matter what), checked dbus to see that change signal was emitted and property returned false
(didn't we have a way to put unit tests into plasmoids? would be nice to test this stuff a bit better)
Diff Detail
Diff Detail
- Repository
- R120 Plasma Workspace
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
libnotificationmanager/server.h | ||
---|---|---|
49 | Having a property which doesn't read what you last wrote leads to very confusing QML. Sure you can make it work, but it won't be declarative. What Server::Private has internally with the 3 inhibtedLocally, inhibitedExternally, and then the read-only effectiveInhibited value is a really neat and tidy design. Can't we map that directly to the public API and properties here? |
Comment Actions
Right. Given it's the applet's responsibility to enforce the inhibition, makes sense it is the only and direct governor of that property.