Bus, main: start at login through the Background portal

A text that arrives while the app is not running waits in imsd until the
app is opened, and nothing notifies. Inside its flatpak the instance now
asks the desktop portal's Background interface when it starts (not for
the --send errand or --headless) to run on with the window closed and to
start `imsd-messages --daemon` at login, the mode that imports and
notifies with no window. The portal keeps the answer and writes the
login entry again at each request it grants, so a deleted entry comes
back while the background permission allows it; set to no, the
permission makes the portal refuse the request, and an entry already
written stays. Outside its own flatpak nothing is asked.

tests/Portal covers the request path the answer arrives on and the
options the request carries.
This commit is contained in:
Jorijn van der Graaf 2026-10-20 23:23:30 +02:00
commit f07a3716b3
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
6 changed files with 221 additions and 9 deletions

View file

@ -28,7 +28,7 @@ and §7.9 (Messaging) and §8.1 (the frozen one).
|---|---|
| `project.cpp` | The build description for Crafter.Build: four products (below) and the tests. |
| `interfaces/ImsdMessages*.cppm` | `imsd-messages-core`: std + Crafter.DB, no GLib, no window — numbers, time, the model, word wrap, gestures, the message field's editing, the store, the sync logic. |
| `interfaces/ImsdMessages.Bus*.cppm` | `imsd-messages-bus`: GLib/GDBus — imsd's dictionaries, the client, notifications, the app's own bus name, the desktop portal's appearance settings. |
| `interfaces/ImsdMessages.Bus*.cppm` | `imsd-messages-bus`: GLib/GDBus — imsd's dictionaries, the client, notifications, the app's own bus name, the desktop portal (appearance, background). |
| `interfaces/ImsdMessages.Ui*.cppm` | `imsd-messages-ui`: the window on Crafter.Graphics, driven from the GLib main loop. |
| `implementations/main.cpp` | The executable `imsd-messages`. |
| `tests/<Name>/main.cpp` | One test per directory, declared in `project.cpp`. |