|
|
@ -105,23 +105,25 @@ namespace Avalonia.X11 |
|
|
public IntPtr DeferredDisplay { get; set; } |
|
|
public IntPtr DeferredDisplay { get; set; } |
|
|
public IntPtr Display { get; set; } |
|
|
public IntPtr Display { get; set; } |
|
|
|
|
|
|
|
|
public ITrayIconImpl CreateTrayIcon () |
|
|
private static uint[] X11IconConverter(IWindowIconImpl? icon) |
|
|
|
|
|
{ |
|
|
|
|
|
if (!(icon is X11IconData x11icon)) |
|
|
|
|
|
return Array.Empty<uint>(); |
|
|
|
|
|
|
|
|
|
|
|
return x11icon.Data.Select(x => x.ToUInt32()).ToArray(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ITrayIconImpl CreateTrayIcon() |
|
|
{ |
|
|
{ |
|
|
var dbusTrayIcon = new DBusTrayIconImpl(); |
|
|
var dbusTrayIcon = new DBusTrayIconImpl(); |
|
|
|
|
|
|
|
|
if (!dbusTrayIcon.IsActive) return new XEmbedTrayIconImpl(); |
|
|
if (!dbusTrayIcon.IsActive) return new XEmbedTrayIconImpl(); |
|
|
|
|
|
|
|
|
dbusTrayIcon.IconConverterDelegate = (icon) => |
|
|
|
|
|
{ |
|
|
|
|
|
if (!(icon is X11IconData x11icon)) |
|
|
|
|
|
return Array.Empty<uint>(); |
|
|
|
|
|
|
|
|
|
|
|
return x11icon.Data.Select(x=>x.ToUInt32()).ToArray(); |
|
|
dbusTrayIcon.IconConverterDelegate = X11IconConverter; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
return dbusTrayIcon; |
|
|
return dbusTrayIcon; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public IWindowImpl CreateWindow() |
|
|
public IWindowImpl CreateWindow() |
|
|
{ |
|
|
{ |
|
|
return new X11Window(this, null); |
|
|
return new X11Window(this, null); |
|
|
|