diff --git a/src/Avalonia.Controls/TrayIcon.cs b/src/Avalonia.Controls/TrayIcon.cs index 1b91a08e34b..4339675a9ee 100644 --- a/src/Avalonia.Controls/TrayIcon.cs +++ b/src/Avalonia.Controls/TrayIcon.cs @@ -7,6 +7,7 @@ using Avalonia.Controls.Platform; using Avalonia.Platform; using Avalonia.Reactive; +using Avalonia.Threading; namespace Avalonia.Controls { @@ -64,12 +65,7 @@ static TrayIcon() } }); - var app = Application.Current ?? throw new InvalidOperationException("Application not yet initialized."); - - if (app.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime lifetime) - { - lifetime.Exit += Lifetime_Exit; - } + Dispatcher.UIThread.ShutdownStarted += ShutdownStarted; } /// @@ -184,7 +180,7 @@ public bool IsVisible internal ITrayIconImpl? Impl => _impl; - private static void Lifetime_Exit(object? sender, ControlledApplicationLifetimeExitEventArgs e) + private static void ShutdownStarted(object? sender, EventArgs? e) { var app = Application.Current ?? throw new InvalidOperationException("Application not yet initialized."); var trayIcons = GetIcons(app); diff --git a/src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs b/src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs index 73444704b8d..43093601c0b 100644 --- a/src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs +++ b/src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs @@ -71,11 +71,11 @@ private async void WatchAsync() var nameOwner = await _dBus.GetNameOwnerAsync("org.kde.StatusNotifierWatcher"); OnNameChange("org.kde.StatusNotifierWatcher", nameOwner); } - catch + catch (Exception e) { _serviceWatchDisposable = null; Logger.TryGet(LogEventLevel.Error, "DBUS") - ?.Log(this, "Interface 'org.kde.StatusNotifierWatcher' is unavailable."); + ?.Log(this, "Interface 'org.kde.StatusNotifierWatcher' is unavailable.\n{Exception}", e); } } diff --git a/src/Browser/Avalonia.Browser/webapp/package-lock.json b/src/Browser/Avalonia.Browser/webapp/package-lock.json index cc1262fc47a..12aa6660d80 100644 --- a/src/Browser/Avalonia.Browser/webapp/package-lock.json +++ b/src/Browser/Avalonia.Browser/webapp/package-lock.json @@ -731,30 +731,6 @@ "integrity": "sha512-OnYr1rkMVxtmMHIAKZLMcEUlJmqcbxBz9QoBU8G9v455na0fuzlT/GLu6l+SRghrk0Mm2fSSciMmzV43Q8e0Gg==", "dev": true, "hasInstallScript": true, - "dependencies": { - "@esbuild/android-arm": "0.15.9", - "@esbuild/linux-loong64": "0.15.9", - "esbuild-android-64": "0.15.9", - "esbuild-android-arm64": "0.15.9", - "esbuild-darwin-64": "0.15.9", - "esbuild-darwin-arm64": "0.15.9", - "esbuild-freebsd-64": "0.15.9", - "esbuild-freebsd-arm64": "0.15.9", - "esbuild-linux-32": "0.15.9", - "esbuild-linux-64": "0.15.9", - "esbuild-linux-arm": "0.15.9", - "esbuild-linux-arm64": "0.15.9", - "esbuild-linux-mips64le": "0.15.9", - "esbuild-linux-ppc64le": "0.15.9", - "esbuild-linux-riscv64": "0.15.9", - "esbuild-linux-s390x": "0.15.9", - "esbuild-netbsd-64": "0.15.9", - "esbuild-openbsd-64": "0.15.9", - "esbuild-sunos-64": "0.15.9", - "esbuild-windows-32": "0.15.9", - "esbuild-windows-64": "0.15.9", - "esbuild-windows-arm64": "0.15.9" - }, "bin": { "esbuild": "bin/esbuild" }, @@ -2353,9 +2329,6 @@ } ], "license": "MIT", - "dependencies": { - "fetch-blob": "^3.2.0" - }, "engines": { "node": ">=14.8.0" },