d2phap/ImageGlass · warning · NotSupportedException
IGE: This feature is not supported on Linux.
Error message
IGE: This feature is not supported on Linux.
What it means
Thrown by LinuxShellProvider.SetDefaultPhotoViewerAsync — the Linux implementation of IShellProvider cannot register ImageGlass as the system default photo viewer. Unlike Windows/macOS, Linux has no single portable default-app API: MIME handler registration is desktop-specific (gnome, kde, etc.) and the host chose not to implement any of them, so it throws NotSupportedException unconditionally.
Source
Thrown at source/ImageGlass.Linux/Common/ServiceProviders/LinuxShellProvider.cs:189
if (string.IsNullOrWhiteSpace(dirPath)) return;
try
{
Directory.CreateDirectory(dirPath);
}
catch { }
// Open the folder in the default file manager.
XdgPortal.ShowFolders(dirPath);
}
/// <summary>
/// <inheritdoc/>
/// </summary>
public Task<DefaultAppScope?> SetDefaultPhotoViewerAsync(string[] extensions, bool enable)
{
throw new NotSupportedException("IGE: This feature is not supported on Linux.");
}
/// <summary>
/// <inheritdoc/>
/// </summary>
public Task SetLockScreenAsync(string filePath)
{
throw new NotSupportedException("IGE: This feature is not supported on Linux.");
}
/// <summary>
/// <inheritdoc/>
/// </summary>
public void SetWallpaper(string filePath)
{
// Route through the Wallpaper portal so it works inside the FlatpakView on GitHub (pinned to 4a3c4fecef)
Solutions
- Gate the UI/control that triggers SetDefaultPhotoViewerAsync on platform: hide or disable it on Linux (use Avalonia OnPlatform on IsVisible).
- Catch NotSupportedException and show an informational 'not supported on Linux' message instead of crashing.
- If the feature is required on Linux, implement MIME-handler registration per desktop environment and replace the throw with real logic.
- Before calling, query the provider capability (or use OperatingSystem.IsWindows/macOS()) to skip the call on Linux.
Example fix
// before (caller)
await Core.ShellProvider.SetDefaultPhotoViewerAsync(exts, enable);
// after — guard on platform and surface gracefully
try { await Core.ShellProvider.SetDefaultPhotoViewerAsync(exts, enable); }
catch (NotSupportedException) { await ShowInfoAsync("Setting the default photo viewer is not supported on this OS."); }
// XAML — hide the trigger on Linux
<Button IsVisible="{OnPlatform False, Linux=False, Windows=True, macOS=True}" .../> Defensive patterns
Strategy: validation
Validate before calling
// Only call the default-viewer API where supported.
if (!OperatingSystem.IsWindows() && !OperatingSystem.IsMacOS())
return; // Linux unsupported
await Core.ShellProvider.SetDefaultPhotoViewerAsync(extensions, enable); Type guard
static bool PlatformSupportsDefaultViewer() =>
OperatingSystem.IsWindows() || OperatingSystem.IsMacOS(); Try / catch
try { await Core.ShellProvider.SetDefaultPhotoViewerAsync(extensions, enable); }
catch (NotSupportedException) { await ShowInfoAsync("Setting the default photo viewer is not supported on this OS."); } Prevention
- Hide/disable the 'set as default photo viewer' control on Linux via Avalonia OnPlatform.
- Query OperatingSystem.IsWindows/macOS() before calling the shell provider.
- Do not let a generic 'set defaults' flow call unsupported provider methods.
- If implementing on Linux, write per-desktop MIME registration and replace the throw.
When it happens
Trigger: Produced at LinuxShellProvider.cs:189 the moment SetDefaultPhotoViewerAsync is called, regardless of arguments. Reached when the Linux app exposes a 'set as default photo viewer' action and the user triggers it.
Common situations: Settings page or first-run flow invoking SetDefaultPhotoViewerAsync on Linux because the UI did not hide the option for this platform; a feature that calls the shell provider generically without checking OS support; porting a Windows-centric feature to Linux without gating the call.
Related errors
- IGE: This feature is not supported on {BHelper.OS}.
- IGE: Could not move the file to trash: {filePath}
- IGE: This feature is not supported on macOS.
AI-assisted analysis of d2phap/ImageGlass@4a3c4fecef (2026-08-13).
Data as JSON: /api/errors/27b15e31e09fa972.
Report an issue: GitHub.