Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions data/io.github.meehow.Receiver.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@
<default>800</default>
<summary>Window height</summary>
</key>
<key name="window-x" type="i">
<default>-1</default>
<summary>Window X position</summary>
<description>The last saved X position of the window (-1 means using default positioning).</description>
</key>
<key name="window-y" type="i">
<default>-1</default>
<summary>Window Y position</summary>
<description>The last saved Y position of the window (-1 means using default positioning).</description>
</key>
<key name="run-in-background" type="b">
<default>true</default>
<summary>Run in background</summary>
<description>Whether the app keeps running when the window is closed.</description>
</key>

</schema>
</schemalist>
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
receiver (0.5.0-1) unstable; urgency=medium
receiver (0.6.0-1) unstable; urgency=medium

* Replace home screen with dedicated Browse and Favourites tabs
* Add mouse wheel scrolling for genre and country pill navigation
Expand Down
57 changes: 57 additions & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Changes — Receiver v0.6.0

## Background execution

The app now stays alive in the background when the window is closed, keeping playback active. Re-launching the app restores the existing window instead of creating a new instance.

- Window hides on close instead of being destroyed, preserving playback
- Instance is now unique (`ApplicationFlags.NON_UNIQUE` removed) so re-launching calls `present()` on the existing window
- `window.vala:34-44` — `close_request` returns `true` (hide) instead of `false` (destroy)
- `application.vala:9,63-65,103` — `db_opened` guard prevents redundant `open_database()` calls on re-activation

## Run in Background (toggle)

A new checkbox menu item lets the user control whether the app stays in the background.

- **GSettings key** `run-in-background` (`b`, default `true`) added to `data/...gschema.xml`
- **Menu item** "Run in Background" added to the hamburger menu between "Song History" and "About Receiver"
- **Stateful action** `win.run-in-background` created in `setup_win_actions()`, synced to GSettings via `notify["state"]`
- **Conditional close**: if nothing is playing (`STOPPED` or `ERROR`), the app closes fully regardless of the flag; the flag is only consulted when playback is active (`PLAYING` or `PAUSED`)

## Window position save/restore (X11)

The window position is now remembered and restored across sessions on X11.

- **GSettings keys** `window-x` and `window-y` (`i`, default `-1` = unset)
- **meson.build**: optional `x11` dependency detected at build time; defines `--define=X11` and links `gtk4-x11`/`x11` Vala packages when available
- `save_window_position()` uses `XGetWindowAttributes` in `close_request`
- `restore_window_position()` uses `XMoveWindow` in `map` signal, deferred via `Idle.add` for WM placement
- Gracefully skipped on Wayland (X11 APIs not available at runtime)

## Translations

126 `.po` files updated to include the new "Run in background" string.

- `.pot` regenerated via `make translations-update`
- All 126 language files received translations for the new string

## Infrastructure

- **Version** bumped from 0.5.0 to 0.6.0 in `meson.build`, `debian/changelog`, and `snap/snapcraft.yaml`
- **AGENTS.md** added with build commands, architecture overview, and repo-specific quirks

---

### Files modified

| File | Change |
|---|---|
| `src/widgets/window.vala` | Background execution, position save/restore, run-in-background toggle, conditional close |
| `src/application.vala` | Single-instance (`NON_UNIQUE` removed), `db_opened` guard |
| `data/io.github.meehow.Receiver.gschema.xml` | Added `window-x`, `window-y`, `run-in-background` keys |
| `meson.build` | Optional X11 dependency, version bump |
| `debian/changelog` | Version bump |
| `snap/snapcraft.yaml` | Version bump |
| `AGENTS.md` | New file — agent instructions |
| `po/*.po` (126 files) | Translations for "Run in background" |
| `po/receiver.pot` | Regenerated template |
9 changes: 8 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('receiver', 'vala', 'c',
version: '0.5.0',
version: '0.6.0',
meson_version: '>= 0.59.0',
default_options: ['warning_level=2']
)
Expand All @@ -20,6 +20,12 @@ sqlite_dep = dependency('sqlite3')
ytdl_subproject = subproject('ytdl')
ytdl_dep = ytdl_subproject.get_variable('ytdl_dep')

# Optional X11 support for window position save/restore
x11_dep = dependency('x11', required: false)
if x11_dep.found()
add_project_arguments('--define=X11', '--pkg', 'gtk4-x11', '--pkg', 'x11', language: 'vala')
endif

# i18n configuration - define GETTEXT_PACKAGE for all C files
add_project_arguments('-DGETTEXT_PACKAGE="' + meson.project_name() + '"', language: 'c')
add_project_arguments('-DG_LOG_DOMAIN="receiver"', language: 'c')
Expand Down Expand Up @@ -69,6 +75,7 @@ executable('receiver',
json_dep,
sqlite_dep,
ytdl_dep,
x11_dep,
],
install: true
)
Expand Down
50 changes: 27 additions & 23 deletions po/af.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,108 +3,112 @@ msgid ""
msgstr ""
"Project-Id-Version: receiver\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-04-02 22:36+0200\n"
"POT-Creation-Date: 2026-05-24 22:02-0400\n"
"Language: af\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: src/widgets/window.vala:54
#: src/widgets/window.vala:72
msgid "Menu"
msgstr "Kieslys"

#. History page (pushed on demand)
#: src/widgets/window.vala:64 src/widgets/window.vala:120
#: src/widgets/window.vala:82 src/widgets/window.vala:139
#: src/widgets/history_page.vala:21
msgid "Song History"
msgstr "Liedgeskiedenis"

#: src/widgets/window.vala:65
#: src/widgets/window.vala:83
msgid "Run in background"
msgstr "Loop in agtergrond"

#: src/widgets/window.vala:84
msgid "About Receiver"
msgstr "Oor Receiver"

#: src/widgets/window.vala:95
#: src/widgets/window.vala:114
msgid "Browse"
msgstr "Blaai"

#: src/widgets/window.vala:99
#: src/widgets/window.vala:118
msgid "Favourites"
msgstr "Gunstelinge"

#. Station info page (pushed on demand)
#: src/widgets/window.vala:125 src/widgets/station_info_page.vala:25
#: src/widgets/window.vala:144 src/widgets/station_info_page.vala:25
msgid "Station Info"
msgstr "Stasie-inligting"

#: src/widgets/window.vala:151
#: src/widgets/window.vala:170
#, c-format
msgid "Loaded %d stations"
msgstr "%d stasies gelaai"

#. User dismissed the dialog — no toast needed
#: src/widgets/window.vala:156 src/services/song_downloader.vala:69
#: src/widgets/window.vala:175 src/services/song_downloader.vala:69
#: src/services/song_downloader.vala:148
#, c-format
msgid "Error: %s"
msgstr "Fout: %s"

#: src/widgets/window.vala:160
#: src/widgets/window.vala:179
#, c-format
msgid "Playback error: %s"
msgstr "Terugspeel-fout: %s"

#: src/widgets/window.vala:173
#: src/widgets/window.vala:192
#, c-format
msgid "Now playing: %s"
msgstr "Speel nou: %s"

#: src/widgets/window.vala:190
#: src/widgets/window.vala:209
#, c-format
msgid "Resuming: %s"
msgstr "Hervat: %s"

#: src/widgets/window.vala:217
#: src/widgets/window.vala:291
msgid "Cancel Last.fm Authorization"
msgstr "Kanselleer Last.fm-magtiging"

#: src/widgets/window.vala:219
#: src/widgets/window.vala:293
msgid "Disconnect from Last.fm"
msgstr "Ontkoppel van Last.fm"

#: src/widgets/window.vala:221
#: src/widgets/window.vala:295
msgid "Connect to Last.fm"
msgstr "Koppel aan Last.fm"

#: src/widgets/window.vala:229
#: src/widgets/window.vala:303
msgid "Last.fm authorization cancelled"
msgstr "Last.fm-magtiging gekanselleer"

#: src/widgets/window.vala:235
#: src/widgets/window.vala:309
msgid "Disconnected from Last.fm"
msgstr "Van Last.fm ontkoppel"

#: src/widgets/window.vala:239
#: src/widgets/window.vala:313
msgid "Connecting to Last.fm…"
msgstr "Verbind met Last.fm…"

#: src/widgets/window.vala:243
#: src/widgets/window.vala:317
msgid "Failed to connect to Last.fm"
msgstr "Kon nie aan Last.fm koppel nie"

#: src/widgets/window.vala:250
#: src/widgets/window.vala:324
msgid "Grant access in your browser…"
msgstr "Gee toegang in jou blaaier…"

#: src/widgets/window.vala:258
#: src/widgets/window.vala:332
msgid "Last.fm authorization timed out"
msgstr "Last.fm-magtiging het uitgetel"

#: src/widgets/window.vala:266
#: src/widgets/window.vala:340
msgid "Connected to Last.fm"
msgstr "Aan Last.fm gekoppel"

#: src/widgets/window.vala:287
#: src/widgets/window.vala:361
msgid "Discover 30,000+ verified radio stations from around the world"
msgstr "Ontdek 30,000+ geverifieerde radiostasies van regoor die wêreld"

Expand Down
50 changes: 27 additions & 23 deletions po/ak.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,108 +3,112 @@ msgid ""
msgstr ""
"Project-Id-Version: receiver\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-04-02 22:36+0200\n"
"POT-Creation-Date: 2026-05-24 22:02-0400\n"
"Language: ak\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#: src/widgets/window.vala:54
#: src/widgets/window.vala:72
msgid "Menu"
msgstr "Menu"

#. History page (pushed on demand)
#: src/widgets/window.vala:64 src/widgets/window.vala:120
#: src/widgets/window.vala:82 src/widgets/window.vala:139
#: src/widgets/history_page.vala:21
msgid "Song History"
msgstr "Nnwom Ho Abakɔsɛm"

#: src/widgets/window.vala:65
#: src/widgets/window.vala:83
msgid "Run in background"
msgstr "Run in background"

#: src/widgets/window.vala:84
msgid "About Receiver"
msgstr "Fa Receiver Ho"

#: src/widgets/window.vala:95
#: src/widgets/window.vala:114
msgid "Browse"
msgstr "Hwehwɛ"

#: src/widgets/window.vala:99
#: src/widgets/window.vala:118
msgid "Favourites"
msgstr "Nea wopɛ"

#. Station info page (pushed on demand)
#: src/widgets/window.vala:125 src/widgets/station_info_page.vala:25
#: src/widgets/window.vala:144 src/widgets/station_info_page.vala:25
msgid "Station Info"
msgstr "Dwumadibea ho nsɛm"

#: src/widgets/window.vala:151
#: src/widgets/window.vala:170
#, c-format
msgid "Loaded %d stations"
msgstr "Wɔde nneɛma %d ahyɛ mu"

#. User dismissed the dialog — no toast needed
#: src/widgets/window.vala:156 src/services/song_downloader.vala:69
#: src/widgets/window.vala:175 src/services/song_downloader.vala:69
#: src/services/song_downloader.vala:148
#, c-format
msgid "Error: %s"
msgstr "Mfomso: %s"

#: src/widgets/window.vala:160
#: src/widgets/window.vala:179
#, c-format
msgid "Playback error: %s"
msgstr "Bɔ mu mfomso: %s"

#: src/widgets/window.vala:173
#: src/widgets/window.vala:192
#, c-format
msgid "Now playing: %s"
msgstr "Seisei rebɔ: %s"

#: src/widgets/window.vala:190
#: src/widgets/window.vala:209
#, c-format
msgid "Resuming: %s"
msgstr "Resan abɔ: %s"

#: src/widgets/window.vala:217
#: src/widgets/window.vala:291
msgid "Cancel Last.fm Authorization"
msgstr "Gyae Last.fm Tumi"

#: src/widgets/window.vala:219
#: src/widgets/window.vala:293
msgid "Disconnect from Last.fm"
msgstr "Tew wo ho fi Last.fm"

#: src/widgets/window.vala:221
#: src/widgets/window.vala:295
msgid "Connect to Last.fm"
msgstr "Ka wo ho hyɛ Last.fm"

#: src/widgets/window.vala:229
#: src/widgets/window.vala:303
msgid "Last.fm authorization cancelled"
msgstr "Last.fm tumi agyae"

#: src/widgets/window.vala:235
#: src/widgets/window.vala:309
msgid "Disconnected from Last.fm"
msgstr "Wɔatew wo ho afi Last.fm"

#: src/widgets/window.vala:239
#: src/widgets/window.vala:313
msgid "Connecting to Last.fm…"
msgstr "Rekafo Last.fm…"

#: src/widgets/window.vala:243
#: src/widgets/window.vala:317
msgid "Failed to connect to Last.fm"
msgstr "Antumi anka ho anhyɛ Last.fm"

#: src/widgets/window.vala:250
#: src/widgets/window.vala:324
msgid "Grant access in your browser…"
msgstr "Ma kwan wɔ wo browser mu…"

#: src/widgets/window.vala:258
#: src/widgets/window.vala:332
msgid "Last.fm authorization timed out"
msgstr "Last.fm tumi bere asa"

#: src/widgets/window.vala:266
#: src/widgets/window.vala:340
msgid "Connected to Last.fm"
msgstr "Wɔaka ho ahyɛ Last.fm"

#: src/widgets/window.vala:287
#: src/widgets/window.vala:361
msgid "Discover 30,000+ verified radio stations from around the world"
msgstr "Hu radio steshɔn 30,000+ firi wiase nyinaa"

Expand Down
Loading