Fix false-positive "GStreamer Not Found" warning in Preferences
The Preferences window's availability probe (added to surface missing GStreamer deps in-UI) reused loadGstreamerModules(), which also checks for Cogl. Cogl is Mutter's private library — its typelib is only reachable from inside the actual gnome-shell process (which gets a private GI search path), never from the separate, plain-GTK4 Preferences process. So the check always failed there with "Requiring Cogl ... not found" even when live wallpapers were working correctly in the real shell process, as confirmed by a user report where the extension's own log showed live wallpaper playback starting cleanly while Preferences simultaneously claimed GStreamer was missing. Split into loadGstreamerModules() (Gst+GstApp+Cogl, used only by liveWallpaper.js in the shell process) and a new lighter checkGstreamerBaseAvailable() (Gst+GstApp only) for prefs.js, with a note in the UI that a clean check there isn't a full guarantee since the private half can't be verified from that process. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019RDqbdjsiisSU7CbQke4g8
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
/**
|
||||
* Loads the GObject-Introspection bindings the live wallpaper feature needs
|
||||
* (Gst, GstApp for the appsink signals, Cogl for uploading decoded frames)
|
||||
* and initializes GStreamer. Shared by extension.js (to actually run the
|
||||
* pipeline) and prefs.js (to tell the user up front why the feature is
|
||||
* greyed out), since either process may be missing the system packages
|
||||
* that provide these typelibs.
|
||||
* and initializes GStreamer. Used by liveWallpaper.js, which only ever runs
|
||||
* inside the gnome-shell process itself.
|
||||
*
|
||||
* Throws with a descriptive message on failure; never caches a *failure*,
|
||||
* since the user may install the missing packages and reopen preferences
|
||||
* without restarting the shell.
|
||||
* Cogl is Mutter's *private* library: its typelib is only reachable from
|
||||
* gnome-shell's own process (which gets a private search path), never from
|
||||
* an ordinary GTK application. Do NOT reuse this for a diagnostic check in
|
||||
* prefs.js — that runs in a separate, plain GTK4 process where importing
|
||||
* Cogl will *always* fail regardless of whether live wallpapers actually
|
||||
* work, producing a false "not found" report. Use
|
||||
* checkGstreamerBaseAvailable() there instead.
|
||||
*/
|
||||
export async function loadGstreamerModules() {
|
||||
const [{default: Gst}, , {default: Cogl}] = await Promise.all([
|
||||
@@ -23,6 +25,23 @@ export async function loadGstreamerModules() {
|
||||
return {Gst, Cogl};
|
||||
}
|
||||
|
||||
/**
|
||||
* Lighter check for prefs.js: confirms the system-wide GStreamer packages
|
||||
* (Gst core + the "app" plugin providing GstApp) are installed, without
|
||||
* touching Cogl. This can't fully confirm live wallpapers will work (that
|
||||
* also needs Cogl, only checkable from inside gnome-shell itself), but a
|
||||
* failure here is a genuine, actionable problem, unlike a Cogl probe.
|
||||
*/
|
||||
export async function checkGstreamerBaseAvailable() {
|
||||
const [{default: Gst}] = await Promise.all([
|
||||
import('gi://Gst?version=1.0'),
|
||||
import('gi://GstApp?version=1.0'),
|
||||
]);
|
||||
|
||||
if (!Gst.is_initialized())
|
||||
Gst.init(null);
|
||||
}
|
||||
|
||||
export const GSTREAMER_INSTALL_HINT =
|
||||
'Install GStreamer’s "base" and "good" plugin sets (with their GObject-Introspection data), ' +
|
||||
'which provide playback and GIF decoding:\n' +
|
||||
|
||||
Reference in New Issue
Block a user