From b44fde96137edf352e96239dcad1955ba8b889eb Mon Sep 17 00:00:00 2001 From: Jurjen Biewenga Date: Mon, 25 Sep 2017 21:10:34 +0200 Subject: [PATCH] Fixed bug that created new instance of ScreenImpl every time it was accessed through WindowBaseImpl --- src/Gtk/Avalonia.Gtk3/WindowBaseImpl.cs | 5 ++++- src/OSX/Avalonia.MonoMac/WindowBaseImpl.cs | 5 ++++- src/Windows/Avalonia.Win32/WindowImpl.cs | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Gtk/Avalonia.Gtk3/WindowBaseImpl.cs b/src/Gtk/Avalonia.Gtk3/WindowBaseImpl.cs index 5725ee2596..225aa2a795 100644 --- a/src/Gtk/Avalonia.Gtk3/WindowBaseImpl.cs +++ b/src/Gtk/Avalonia.Gtk3/WindowBaseImpl.cs @@ -342,7 +342,10 @@ namespace Avalonia.Gtk3 Native.GtkWindowResize(GtkWidget, (int)value.Width, (int)value.Height); } - public IScreenImpl Screen { get; } = new ScreenImpl(); + public IScreenImpl Screen + { + get; + } = new ScreenImpl(); public Point Position { diff --git a/src/OSX/Avalonia.MonoMac/WindowBaseImpl.cs b/src/OSX/Avalonia.MonoMac/WindowBaseImpl.cs index 71f008e074..9ce1756aae 100644 --- a/src/OSX/Avalonia.MonoMac/WindowBaseImpl.cs +++ b/src/OSX/Avalonia.MonoMac/WindowBaseImpl.cs @@ -153,7 +153,10 @@ namespace Avalonia.MonoMac Position = pos; } - public IScreenImpl Screen { get; } = new ScreenImpl(); + public IScreenImpl Screen + { + get; + } = new ScreenImpl(); public override Point PointToClient(Point point) { diff --git a/src/Windows/Avalonia.Win32/WindowImpl.cs b/src/Windows/Avalonia.Win32/WindowImpl.cs index dab7f0ba04..4c28d44b93 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.cs +++ b/src/Windows/Avalonia.Win32/WindowImpl.cs @@ -103,7 +103,11 @@ namespace Avalonia.Win32 } } - public IScreenImpl Screen => new ScreenImpl(); + public IScreenImpl Screen + { + get; + } = new ScreenImpl(); + public IRenderer CreateRenderer(IRenderRoot root) {