diff --git a/src/Avalonia.FreeDesktop/DBusMenuExporter.cs b/src/Avalonia.FreeDesktop/DBusMenuExporter.cs
index 95aea86dfe..52450560c0 100644
--- a/src/Avalonia.FreeDesktop/DBusMenuExporter.cs
+++ b/src/Avalonia.FreeDesktop/DBusMenuExporter.cs
@@ -18,8 +18,6 @@ namespace Avalonia.FreeDesktop
{
public static ITopLevelNativeMenuExporter TryCreateTopLevelNativeMenu(IntPtr xid)
{
- return null;
-
if (DBusHelper.Connection == null)
return null;
@@ -94,8 +92,6 @@ namespace Avalonia.FreeDesktop
// and it's not important to know if it succeeds
// since even if we register the window it's not guaranteed that
// menu will be actually exported
-
- Dispose();
}
}
diff --git a/src/Avalonia.FreeDesktop/DBusSystemTray/DBusSysTray.cs b/src/Avalonia.FreeDesktop/DBusSystemTray/DBusSysTray.cs
index 8fd324e84c..dc5b98a41f 100644
--- a/src/Avalonia.FreeDesktop/DBusSystemTray/DBusSysTray.cs
+++ b/src/Avalonia.FreeDesktop/DBusSystemTray/DBusSysTray.cs
@@ -55,9 +55,9 @@ namespace Avalonia.FreeDesktop.DBusSystemTray
}
}
- public void SetIcon(Pixmap pixmap)
+ public void SetIcon(DbusPixmap dbusPixmap)
{
- _statusNotifierItemDbusObj.SetIcon(pixmap);
+ _statusNotifierItemDbusObj.SetIcon(dbusPixmap);
}
public void SetTitleAndTooltip(string text)
@@ -70,7 +70,7 @@ namespace Avalonia.FreeDesktop.DBusSystemTray
_statusNotifierItemDbusObj.ActivationDelegate = activationDelegate;
}
}
-
+
///
/// DBus Object used for setting system tray icons.
///
@@ -90,7 +90,7 @@ namespace Avalonia.FreeDesktop.DBusSystemTray
public Action NewStatusAsync { get; set; }
public Action ActivationDelegate { get; set; }
public ObjectPath ObjectPath { get; }
-
+
public StatusNotifierItemDbusObj()
{
var ID = Guid.NewGuid().ToString().Replace("-", "");
@@ -102,10 +102,11 @@ namespace Avalonia.FreeDesktop.DBusSystemTray
_backingProperties = new StatusNotifierItemProperties
{
- Menu = "/MenuBar", // Needs a dbus menu somehow
- ItemIsMenu = false,
+ Menu = dbusmenuPath, // Needs a dbus menu somehow
ToolTip = new ToolTip("")
};
+
+ InvalidateAll();
}
public async Task ContextMenuAsync(int X, int Y)
@@ -139,7 +140,7 @@ namespace Avalonia.FreeDesktop.DBusSystemTray
OnTitleChanged += handler;
return Disposable.Create(() => OnTitleChanged -= handler);
}
-
+
public async Task WatchNewIconAsync(Action handler, Action onError = null)
{
OnIconChanged += handler;
@@ -151,7 +152,7 @@ namespace Avalonia.FreeDesktop.DBusSystemTray
OnAttentionIconChanged += handler;
return Disposable.Create(() => OnAttentionIconChanged -= handler);
}
-
+
public async Task WatchNewOverlayIconAsync(Action handler, Action onError = null)
{
OnOverlayIconChanged += handler;
@@ -172,6 +173,10 @@ namespace Avalonia.FreeDesktop.DBusSystemTray
public async Task