From 2e4131e6c76c681d9d2f23244af00c3fdd852edc Mon Sep 17 00:00:00 2001 From: Ramez Ragaa Date: Mon, 9 Oct 2023 11:53:16 +0300 Subject: [PATCH] chore: Thread.CurrentThread.ManagedThreadId -> Environment.CurrentManagedThreadId --- src/Uno.UI.Runtime.Skia.Gtk/Input/GtkKeyboardInputSource.cs | 3 +-- src/Uno.UI.Runtime.Skia.Wpf/Input/WpfKeyboardInputSource.cs | 3 +-- src/Uno.UI/UI/Xaml/Documents/InlineCollection.skia.cs | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Uno.UI.Runtime.Skia.Gtk/Input/GtkKeyboardInputSource.cs b/src/Uno.UI.Runtime.Skia.Gtk/Input/GtkKeyboardInputSource.cs index 90b655d52467..a2592b34d126 100644 --- a/src/Uno.UI.Runtime.Skia.Gtk/Input/GtkKeyboardInputSource.cs +++ b/src/Uno.UI.Runtime.Skia.Gtk/Input/GtkKeyboardInputSource.cs @@ -3,7 +3,6 @@ using System; using System.Runtime.InteropServices; using System.Text; -using System.Threading; using Gdk; using Gtk; using Windows.System; @@ -129,7 +128,7 @@ private static string WindowsKeyCodeToUnicode(uint keyCode) } var scanCode = MapVirtualKey(keyCode, 0); - var inputLocaleIdentifier = GetKeyboardLayout((uint)Thread.CurrentThread.ManagedThreadId); + var inputLocaleIdentifier = GetKeyboardLayout((uint)Environment.CurrentManagedThreadId); var result = new StringBuilder(); ToUnicodeEx(keyCode, scanCode, keyboardState, result, (int)5, (uint)0, inputLocaleIdentifier); diff --git a/src/Uno.UI.Runtime.Skia.Wpf/Input/WpfKeyboardInputSource.cs b/src/Uno.UI.Runtime.Skia.Wpf/Input/WpfKeyboardInputSource.cs index 6d56568ba520..c38119b477fc 100644 --- a/src/Uno.UI.Runtime.Skia.Wpf/Input/WpfKeyboardInputSource.cs +++ b/src/Uno.UI.Runtime.Skia.Wpf/Input/WpfKeyboardInputSource.cs @@ -2,7 +2,6 @@ using System; using System.Runtime.InteropServices; using System.Text; -using System.Threading; using Uno.Foundation.Logging; using Windows.Foundation; using Windows.System; @@ -116,7 +115,7 @@ private static string WindowsKeyCodeToUnicode(uint keyCode) } var scanCode = MapVirtualKey(keyCode, 0); - var inputLocaleIdentifier = GetKeyboardLayout((uint)Thread.CurrentThread.ManagedThreadId); + var inputLocaleIdentifier = GetKeyboardLayout((uint)Environment.CurrentManagedThreadId); var result = new StringBuilder(); ToUnicodeEx(keyCode, scanCode, keyboardState, result, (int)5, (uint)0, inputLocaleIdentifier); diff --git a/src/Uno.UI/UI/Xaml/Documents/InlineCollection.skia.cs b/src/Uno.UI/UI/Xaml/Documents/InlineCollection.skia.cs index f80ab70344dd..ac362da80d3b 100644 --- a/src/Uno.UI/UI/Xaml/Documents/InlineCollection.skia.cs +++ b/src/Uno.UI/UI/Xaml/Documents/InlineCollection.skia.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; using SkiaSharp; using Windows.Foundation; using Windows.UI.Composition; @@ -28,7 +26,7 @@ partial class InlineCollection // these should only be used by TextBox. internal (int startLine, int startIndex, int endLine, int endIndex)? Selection { get; set; } - internal (bool atEndOfSelection, Color color)? Caret { get; set; } + internal (bool atEndOfSelection, Windows.UI.Color color)? Caret { get; set; } internal bool RenderSelectionAndCaret { get; set; } ///