Bug 230420

Summary: [GTK] WebKit tries to own org.mpris.MediaPlayer2 bus names even when MEDIA_SESSION disabled
Product: WebKit Reporter: Patrick Griffis <pgriffis>
Component: WebKitGTKAssignee: Patrick Griffis <pgriffis>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, eric.carlson, ews-watchlist, glenn, jer.noble, philipj, pnormand, sergio
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Patrick Griffis 2021-09-17 11:54:32 PDT
If you build webkitgtk without `ENABLE_MEDIA_SESSION` defined you will get warnings:

> ** (WebKitWebProcess:2): WARNING **: 13:27:52.167: Unable to acquire MPRIS D-Bus session ownership for name org.mpris.MediaPlayer2.org.webkitgtk.MiniBrowser

This is because in `BubblewrapLauncher.cpp` the dbus permission is guarded behind `ENABLE(MEDIA_SESSION)`.

At a glance I wasn't sure the best place to disable the MPRIS ownership with another guard, most of the PlatformMediaSessionManager code seems to be guarded by `ENABLE(MEDIA_STREAM)` instead.
Comment 1 Philippe Normand 2021-09-17 14:17:43 PDT
MEDIA_SESSION != MEDIA_STREAM.
What if you guard MediaSessionManagerGLib and RemoteCommandListenerGLib with ENABLE(MEDIA_SESSION)?
Comment 2 Patrick Griffis 2021-09-18 08:07:19 PDT
Created attachment 438559 [details]
Patch
Comment 3 Patrick Griffis 2021-09-18 08:07:51 PDT
That seemed to work, see attached patch.
Comment 4 EWS 2021-09-18 09:12:54 PDT
Committed r282727 (241864@main): <https://commits.webkit.org/241864@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 438559 [details].