MSWindows: TListView.OnContextPopup is called twice
Original Reporter info from Mantis: nanobit @nanobit
-
Reporter name:
Original Reporter info from Mantis: nanobit @nanobit
- Reporter name:
Description:
In TListView (with Multiselect = true),
on empty space (where no item is hit), right click to trigger OnContextPopup.
TListView.OnContextPopup (TControl.WMContextMenu()) is called two times,
thus the menu is shown twice.
The reason is in win32wscustomlistview.inc / ListViewProc() which ignores OnContextPopup.
A solution is: replace
"not Assigned(ListView.PopupMenu))"
with:
"not (Assigned(ListView.PopupMenu) or Assigned(ListView.OnContextPopup)))"
This also requires:
TcustomListView.OnContextPopup to be public instead of protected.
This fixes the reported bug, but the source section is probably not enough overall,
if this section is also related to: https://bugs.freepascal.org/view.php?id=35362
Mantis conversion info:
- Mantis ID: 35917
- OS: Windows
- OS Build: 10
- Platform: win32
- Version: 2.0.2
- Fixed in version: 2.2
- Fixed in revision: 63012 (#13e6d2cd),63013 (#11e9158f),63022 (#f37a0afd),63023 (#ab05c01a)
- Monitored by: » @martin_frb (Martin Friebe)
- Target version: 2.2