From 8920dc40beb43d644b2519d506d7848f54888ee5 Mon Sep 17 00:00:00 2001 From: Udo Hoffmann Date: Sat, 4 Jul 2020 10:07:12 +0200 Subject: [PATCH] Fix Flickering cursor after double-clicking a found line Fix #8487, fix #8522 --- PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index be6aacf9..266ed076 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -489,6 +489,11 @@ bool Finder::notify(SCNotification *notification) { // remove selection from the finder isDoubleClicked = true; + + // WM_LBUTTONUP can go to a "File not found" messagebox instead of Scintilla here, because the mouse is not captured. + // The missing message causes mouse cursor flicker as soon as the mouse cursor is moved to a position outside the text editing area. + ::SendMessage(_scintView.getHSelf(), WM_LBUTTONUP, 0, 0); + size_t pos = notification->position; if (pos == INVALID_POSITION) pos = static_cast(_scintView.execute(SCI_GETLINEENDPOSITION, notification->line)); @@ -528,7 +533,8 @@ void Finder::gotoFoundLine() const FoundInfo fInfo = *(_pMainFoundInfos->begin() + lno); // Switch to another document - ::SendMessage(::GetParent(_hParent), WM_DOOPEN, 0, reinterpret_cast(fInfo._fullPath.c_str())); + if (!::SendMessage(::GetParent(_hParent), WM_DOOPEN, 0, reinterpret_cast(fInfo._fullPath.c_str()))) return; + (*_ppEditView)->_positionRestoreNeeded = false; Searching::displaySectionCentered(fInfo._start, fInfo._end, *_ppEditView);