Skip to content

Commit 09f8b3e

Browse files
committed
Finally fix setting metadata in Flatpak!
1 parent 0d099f3 commit 09f8b3e

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/pipewire_manager.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,15 @@ PipeWireManager::PipeWireManager() {
340340
Q_EMIT error_occured(QStringLiteral("Failed connecting to PipeWire audio service."));
341341
return;
342342
}
343-
context = pw_context_new(pw_thread_loop_get_loop(thread_loop), nullptr, 0);
343+
344+
pw_properties *props = pw_properties_new(nullptr, nullptr);
345+
pw_properties_set(props, PW_KEY_MEDIA_TYPE, "Audio");
346+
pw_properties_set(props, PW_KEY_MEDIA_ROLE, "Music");
347+
348+
// Required for Flatpak, otherwise it cannot write PipeWire metadata! Also nice to have for native packaging
349+
pw_properties_set(props, PW_KEY_MEDIA_CATEGORY, "Manager");
350+
351+
context = pw_context_new(pw_thread_loop_get_loop(thread_loop), props, 0);
344352
if (!context) {
345353
pw_thread_loop_unlock(thread_loop);
346354
qWarning("Failed to create PipeWire context");

0 commit comments

Comments
 (0)