diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 89f1514f6..5547839be 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -4280,15 +4280,17 @@ void Notepad_plus::dropFiles(HDROP hdrop) if (hdrop) { // Determinate in which view the file(s) is (are) dropped - POINT p; + POINT p{}; ::DragQueryPoint(hdrop, &p); HWND hWin = ::ChildWindowFromPointEx(_pPublicInterface->getHSelf(), p, CWP_SKIPINVISIBLE); if (!hWin) return; - if ((_subEditView.getHSelf() == hWin) || (_subDocTab.getHSelf() == hWin) || currentView() == SUB_VIEW) - switchEditViewTo(SUB_VIEW); - else + if ((_mainEditView.getHSelf() == hWin) || (_mainDocTab.getHSelf() == hWin)) switchEditViewTo(MAIN_VIEW); + else if ((_subEditView.getHSelf() == hWin) || (_subDocTab.getHSelf() == hWin)) + switchEditViewTo(SUB_VIEW); + //else + // do not change the current Notepad++ edit-view int filesDropped = ::DragQueryFile(hdrop, 0xffffffff, NULL, 0);