From b2191e9e6f5ad82774ff6dac589e8da9c5ff8091 Mon Sep 17 00:00:00 2001 From: Don HO Date: Wed, 17 Apr 2019 20:50:08 +0200 Subject: [PATCH] Fix unexpected behaviour after double clicking an URL Close #5529 --- PowerEditor/src/NppNotification.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index fe7fad86..cf869a2a 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -1013,9 +1013,10 @@ BOOL Notepad_plus::notify(SCNotification *notification) generic_string url = notifyView->getGenericTextAsString(startPos, endPos); - // remove the flickering: it seems a mouse click is missing after SCN_HOTSPOTDOUBLECLICK - ::PostMessage(notifyView->getHSelf(), WM_LBUTTONDOWN, 0, 0); + // remove the flickering: it seems a mouse left button up is missing after SCN_HOTSPOTDOUBLECLICK ::PostMessage(notifyView->getHSelf(), WM_LBUTTONUP, 0, 0); + auto curPos = notifyView->execute(SCI_GETCURRENTPOS); + notifyView->execute(SCI_SETSEL, curPos, curPos); ::ShellExecute(_pPublicInterface->getHSelf(), TEXT("open"), url.c_str(), NULL, NULL, SW_SHOW);