Prevent sending EVT_MOUSE_CAPTURE_LOST while opening a context menu in wxSTC
At least under wxMSW and wxGTK opening a popup menu when mouse is captured generates EVT_MOUSE_CAPTURE_LOST. We would like to avoid this and to release capture in a controlled way. See #17961.
This commit is contained in:
parent
0fea881f12
commit
6d0cb403a9
@ -1165,6 +1165,10 @@ void ScintillaWX::DoCommand(int ID) {
|
||||
bool ScintillaWX::DoContextMenu(Point pt) {
|
||||
if (ShouldDisplayPopup(pt))
|
||||
{
|
||||
// To prevent generating EVT_MOUSE_CAPTURE_LOST.
|
||||
if ( HaveMouseCapture() ) {
|
||||
SetMouseCapture(false);
|
||||
}
|
||||
ContextMenu(pt);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user