Steven Kirk
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
24 additions and
14 deletions
-
src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs
-
src/Avalonia.Visuals/Media/FormattedText.cs
-
src/Avalonia.X11/X11Window.cs
-
src/Linux/Avalonia.LinuxFramebuffer/FramebufferToplevelImpl.cs
-
src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs
-
src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatformOptions.cs
|
|
|
@ -275,7 +275,7 @@ namespace Avalonia.Controls.Platform |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (item.HasSubMenu) |
|
|
|
if (item.HasSubMenu && item.IsEffectivelyEnabled) |
|
|
|
{ |
|
|
|
Open(item, true); |
|
|
|
} |
|
|
|
|
|
|
|
@ -200,7 +200,7 @@ namespace Avalonia.Media |
|
|
|
|
|
|
|
private void Set<T>(ref T field, T value) |
|
|
|
{ |
|
|
|
if (field != null && field.Equals(value)) |
|
|
|
if (EqualityComparer<T>.Default.Equals(field, value)) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
@ -192,11 +192,6 @@ namespace Avalonia.X11 |
|
|
|
if (platform.Options.UseDBusMenu) |
|
|
|
NativeMenuExporter = DBusMenuExporter.TryCreate(_handle); |
|
|
|
NativeControlHost = new X11NativeControlHost(_platform, this); |
|
|
|
DispatcherTimer.Run(() => |
|
|
|
{ |
|
|
|
Paint?.Invoke(default); |
|
|
|
return _handle != IntPtr.Zero; |
|
|
|
}, TimeSpan.FromMilliseconds(100)); |
|
|
|
InitializeIme(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -30,10 +30,9 @@ namespace Avalonia.LinuxFramebuffer |
|
|
|
|
|
|
|
public IRenderer CreateRenderer(IRenderRoot root) |
|
|
|
{ |
|
|
|
return new DeferredRenderer(root, AvaloniaLocator.Current.GetService<IRenderLoop>()) |
|
|
|
{ |
|
|
|
|
|
|
|
}; |
|
|
|
var factory = AvaloniaLocator.Current.GetService<IRendererFactory>(); |
|
|
|
var renderLoop = AvaloniaLocator.Current.GetService<IRenderLoop>(); |
|
|
|
return factory?.Create(root, renderLoop) ?? new DeferredRenderer(root, renderLoop); |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
@ -41,7 +40,7 @@ namespace Avalonia.LinuxFramebuffer |
|
|
|
throw new NotSupportedException(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Invalidate(Rect rect) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
@ -37,15 +37,17 @@ namespace Avalonia.LinuxFramebuffer |
|
|
|
Threading = new InternalPlatformThreadingInterface(); |
|
|
|
if (_fb is IGlOutputBackend gl) |
|
|
|
AvaloniaLocator.CurrentMutable.Bind<IPlatformOpenGlInterface>().ToConstant(gl.PlatformOpenGlInterface); |
|
|
|
|
|
|
|
var opts = AvaloniaLocator.Current.GetService<LinuxFramebufferPlatformOptions>(); |
|
|
|
|
|
|
|
AvaloniaLocator.CurrentMutable |
|
|
|
.Bind<IPlatformThreadingInterface>().ToConstant(Threading) |
|
|
|
.Bind<IRenderTimer>().ToConstant(new DefaultRenderTimer(60)) |
|
|
|
.Bind<IRenderTimer>().ToConstant(new DefaultRenderTimer(opts?.Fps ?? 60)) |
|
|
|
.Bind<IRenderLoop>().ToConstant(new RenderLoop()) |
|
|
|
.Bind<ICursorFactory>().ToTransient<CursorFactoryStub>() |
|
|
|
.Bind<IKeyboardDevice>().ToConstant(new KeyboardDevice()) |
|
|
|
.Bind<IPlatformSettings>().ToSingleton<PlatformSettings>() |
|
|
|
.Bind<PlatformHotkeyConfiguration>().ToSingleton<PlatformHotkeyConfiguration>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -0,0 +1,14 @@ |
|
|
|
namespace Avalonia.LinuxFramebuffer |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Platform-specific options which apply to the Linux framebuffer.
|
|
|
|
/// </summary>
|
|
|
|
public class LinuxFramebufferPlatformOptions |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the number of frames per second at which the renderer should run.
|
|
|
|
/// Default 60.
|
|
|
|
/// </summary>
|
|
|
|
public int Fps { get; set; } = 60; |
|
|
|
} |
|
|
|
} |