From b17ea8ac5347d2031cb6cbc9d115d20ea169a1e3 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Tue, 28 Sep 2010 13:41:25 +0200 Subject: [PATCH] Fixed SD-1729 - Code completion window stays open when switching to another text editor window --- .../CodeCompletion/CompletionWindowBase.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionWindowBase.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionWindowBase.cs index 124bf6876c..0ad375b8e6 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionWindowBase.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionWindowBase.cs @@ -76,7 +76,8 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion if (document != null) { document.Changing += textArea_Document_Changing; } - this.TextArea.PreviewLostKeyboardFocus += TextAreaLostFocus; + // LostKeyboardFocus seems to be more reliable than PreviewLostKeyboardFocus - see SD-1729 + this.TextArea.LostKeyboardFocus += TextAreaLostFocus; this.TextArea.TextView.ScrollOffsetChanged += TextViewScrollOffsetChanged; this.TextArea.DocumentChanged += TextAreaDocumentChanged; if (parentWindow != null) { @@ -101,7 +102,7 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion if (document != null) { document.Changing -= textArea_Document_Changing; } - this.TextArea.PreviewLostKeyboardFocus -= TextAreaLostFocus; + this.TextArea.LostKeyboardFocus -= TextAreaLostFocus; this.TextArea.TextView.ScrollOffsetChanged -= TextViewScrollOffsetChanged; this.TextArea.DocumentChanged -= TextAreaDocumentChanged; if (parentWindow != null) {