From 5c52aff7a1d9b424f804a2b268a5321e83233439 Mon Sep 17 00:00:00 2001 From: Ashfaaq18 Date: Mon, 30 Aug 2021 13:32:35 +0530 Subject: [PATCH] Fix inconsistency of Document List context menu Document List context menu now appears only when files are selected. Fix #10463, close #10464 --- .../VerticalFileSwitcher.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp index a2115f3eb..074a3a4c6 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp @@ -147,12 +147,16 @@ INT_PTR CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, activateDoc(tlfs); } - // Redirect NM_RCLICK message to Notepad_plus handle - NMHDR nmhdr; - nmhdr.code = NM_RCLICK; - nmhdr.hwndFrom = _hSelf; - nmhdr.idFrom = ::GetDlgCtrlID(nmhdr.hwndFrom); - ::SendMessage(_hParent, WM_NOTIFY, nmhdr.idFrom, reinterpret_cast(&nmhdr)); + + if (nbSelectedFiles() >= 1) + { + // Redirect NM_RCLICK message to Notepad_plus handle + NMHDR nmhdr; + nmhdr.code = NM_RCLICK; + nmhdr.hwndFrom = _hSelf; + nmhdr.idFrom = ::GetDlgCtrlID(nmhdr.hwndFrom); + ::SendMessage(_hParent, WM_NOTIFY, nmhdr.idFrom, reinterpret_cast(&nmhdr)); + } return TRUE; }