Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPF TextBox输入时崩溃了 #9056

Closed
yeqilve opened this issue Apr 26, 2024 · 2 comments
Closed

WPF TextBox输入时崩溃了 #9056

yeqilve opened this issue Apr 26, 2024 · 2 comments

Comments

@yeqilve
Copy link

yeqilve commented Apr 26, 2024

Description

报错堆栈
---- Assert Short Message ----
Invariant failure:
---- Assert Long Message ----

at MS.Internal.Invariant.FailFast(String message, String detailMessage)
at MS.Internal.Invariant.Assert(Boolean condition)
at System.Windows.Documents.TextStore.UpdateCompositionText(FrameworkTextComposition composition)
at System.Windows.Documents.TextStore.RaiseCompositionEvents(Int32& appSelectionAnchorOffset, Int32& appSelectionMovingOffset)
at System.Windows.Documents.TextStore.HandleCompositionEvents(Int32 previousUndoCount)
at System.Windows.Documents.TextStore.GrantLockWorker(LockFlags flags)
at System.Windows.Documents.TextStore.RequestLock(LockFlags flags, Int32& hrSession)
at MS.Win32.UnsafeNativeMethods.ITfMessagePump.GetMessageW(MSG& msg, IntPtr hwnd, Int32 msgFilterMin, Int32 msgFilterMax, Int32& result)
at MS.Win32.UnsafeNativeMethods.ITfMessagePump.GetMessageW(MSG& msg, IntPtr hwnd, Int32 msgFilterMin, Int32 msgFilterMax, Int32& result)
at System.Windows.Threading.Dispatcher.GetMessage(MSG& msg, IntPtr hwnd, Int32 minMessage, Int32 maxMessage)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at WpfApp1.App.Main()

Reproduction Steps

重现方式
window.xaml



window.cs
public MainWindow()
{
InitializeComponent();
test.Text = "1234\n123441";
test.SelectAll();
test.Focus();
}

mainwindow 展示的时候
输入任意字符 就crash了

去掉selectAll 就正常了

Expected behavior

Actual behavior

Regression?

No response

Known Workarounds

No response

Impact

No response

Configuration

No response

Other information

No response

@miloush
Copy link
Contributor

miloush commented Apr 26, 2024

Possibly duplicate of #7304?

@yeqilve
Copy link
Author

yeqilve commented Apr 26, 2024

Possibly duplicate of #7304?

yes

@yeqilve yeqilve closed this as completed Apr 26, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants