From 6f4140a281f87316911776e7375f6c86dc4f5bdc Mon Sep 17 00:00:00 2001 From: Don Ho Date: Fri, 25 Dec 2015 16:41:26 +0100 Subject: [PATCH] Fix Notepad++ hanging issue while user uses touch screen to activate Notepad++ windows Make checkModifiedDocument as thread to avoid Notepad++ hanging while user uses touch screen to activate Notepad++ windows. --- PowerEditor/src/NppBigSwitch.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 35f6146e0..72cc09fbc 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -44,7 +44,11 @@ using namespace std; #define WM_DPICHANGED 0x02E0 - +DWORD WINAPI CheckModifiedDocumentThread(LPVOID) +{ + MainFileManager->checkFilesystemChanges(); + return 0; +} struct SortTaskListPred final { @@ -1347,7 +1351,11 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa if (LOWORD(wParam) && (nppgui._fileAutoDetection != cdDisabled)) { _activeAppInf._isActivated = true; - checkModifiedDocument(); + + //checkModifiedDocument(); + // Make checkModifiedDocument as thread to avoid Notepad++ hanging while user uses touch screen to activate Notepad++ windows + HANDLE hThread = CreateThread(NULL, 0, &CheckModifiedDocumentThread, NULL, 0, NULL); + ::CloseHandle(hThread); return FALSE; } }