Fix wrong dropped file view

Fix #14951, close #14953
pull/15016/head
xomx 8 months ago committed by Don Ho
parent 161bb41425
commit a92a9fd7c7

@ -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);

Loading…
Cancel
Save