From e17d77ceab00931a8b2bbcb6cbdc92b095c6d962 Mon Sep 17 00:00:00 2001 From: Alan Kilborn Date: Thu, 1 Aug 2024 20:36:42 -0400 Subject: [PATCH] Fix edit zone not getting focus while clicking the active tab Move input focus to editor when clicking on already-active tab. Fix #8446, close #15508 --- PowerEditor/src/NppNotification.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index 6a26c6cec..b27017462 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -371,24 +371,30 @@ BOOL Notepad_plus::notify(SCNotification *notification) _statusBar.setText((_pEditView->execute(SCI_GETOVERTYPE)) ? L"OVR" : L"INS", STATUSBAR_TYPING_MODE); } } - else if (notification->nmhdr.hwndFrom == _mainDocTab.getHSelf() && _activeView == SUB_VIEW) + else if (notification->nmhdr.hwndFrom == _mainDocTab.getHSelf()) { - bool isSnapshotMode = NppParameters::getInstance().getNppGUI().isSnapshotMode(); - if (isSnapshotMode) + if (_activeView == SUB_VIEW) { - // Before switching off, synchronize backup file - MainFileManager.backupCurrentBuffer(); + bool isSnapshotMode = NppParameters::getInstance().getNppGUI().isSnapshotMode(); + if (isSnapshotMode) + { + // Before switching off, synchronize backup file + MainFileManager.backupCurrentBuffer(); + } } // Switch off switchEditViewTo(MAIN_VIEW); } - else if (notification->nmhdr.hwndFrom == _subDocTab.getHSelf() && _activeView == MAIN_VIEW) + else if (notification->nmhdr.hwndFrom == _subDocTab.getHSelf()) { - bool isSnapshotMode = NppParameters::getInstance().getNppGUI().isSnapshotMode(); - if (isSnapshotMode) + if (_activeView == MAIN_VIEW) { - // Before switching off, synchronize backup file - MainFileManager.backupCurrentBuffer(); + bool isSnapshotMode = NppParameters::getInstance().getNppGUI().isSnapshotMode(); + if (isSnapshotMode) + { + // Before switching off, synchronize backup file + MainFileManager.backupCurrentBuffer(); + } } // Switch off switchEditViewTo(SUB_VIEW);