mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-10 06:25:00 +03:00
Avoid reentrant log scrolling during Avalonia window dragging (#10271)
This commit is contained in:
@@ -47,9 +47,14 @@ public partial class MsgView : ReactiveUserControl<MsgViewModel>
|
|||||||
if (togScrollToEnd.IsChecked ?? true)
|
if (togScrollToEnd.IsChecked ?? true)
|
||||||
{
|
{
|
||||||
txtMsg.ScrollToEnd();
|
txtMsg.ScrollToEnd();
|
||||||
Dispatcher.UIThread.Invoke(() =>
|
// Let layout finish without a nested dispatcher loop during a native window drag.
|
||||||
txtMsg.ScrollTo(txtMsg.LineCount, 0, AvaloniaEdit.Rendering.VisualYPosition.TextBottom, txtMsg.Bounds.Height, 0),
|
Dispatcher.UIThread.Post(() =>
|
||||||
DispatcherPriority.Background);
|
{
|
||||||
|
if (togScrollToEnd.IsChecked ?? true)
|
||||||
|
{
|
||||||
|
txtMsg.ScrollTo(txtMsg.LineCount, 0, AvaloniaEdit.Rendering.VisualYPosition.TextBottom, txtMsg.Bounds.Height, 0);
|
||||||
|
}
|
||||||
|
}, DispatcherPriority.Background);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user