Platform: Windows with Qt 5.15.2
Scintilla version: 5.3.5
In version 5.3.5 the ScintillaEditBase::contextMenuEvent function does not allow for the parent widget to create a pop-up menu when SCI_USEPOPUP is set to SC_POPUP_NEVER. That's because the function doesn't tell the incoming event that it's being ignored. If it is not told that it is being ignored, then it will never propagate up to the parent widget.
This:
void ScintillaEditBase::contextMenuEvent(QContextMenuEvent *event)
{
Point pos = PointFromQPoint(event->globalPos());
Point pt = PointFromQPoint(event->pos());
if (!sqt->PointInSelection(pt)) {
sqt->SetEmptySelection(sqt->PositionFromLocation(pt));
}
if (sqt->ShouldDisplayPopup(pt)) {
sqt->ContextMenu(pos);
}
}
Should be changed to:
void ScintillaEditBase::contextMenuEvent(QContextMenuEvent *event)
{
Point pos = PointFromQPoint(event->globalPos());
Point pt = PointFromQPoint(event->pos());
if (!sqt->PointInSelection(pt)) {
sqt->SetEmptySelection(sqt->PositionFromLocation(pt));
}
if (sqt->ShouldDisplayPopup(pt)) {
sqt->ContextMenu(pos);
event->accept();
}
else {
event->ignore();
}
}
Committed with [753c28].
Related
Commit: [753c28]