Try to fix a crash in label click handlers.
This commit is contained in:
parent
8d634fc946
commit
8589a8d850
1 changed files with 9 additions and 5 deletions
|
|
@ -444,11 +444,15 @@ Text::StateResult FlatLabel::dragActionFinish(const QPoint &p, Qt::MouseButton b
|
|||
_selectionType = TextSelectType::Letters;
|
||||
|
||||
if (activated) {
|
||||
const auto guard = window();
|
||||
if (!_clickHandlerFilter
|
||||
|| _clickHandlerFilter(activated, button)) {
|
||||
ActivateClickHandler(guard, activated, button);
|
||||
}
|
||||
// _clickHandlerFilter may delete `this`. In that case we don't want
|
||||
// to try to show a context menu or smth like that.
|
||||
crl::on_main(this, [=] {
|
||||
const auto guard = window();
|
||||
if (!_clickHandlerFilter
|
||||
|| _clickHandlerFilter(activated, button)) {
|
||||
ActivateClickHandler(guard, activated, button);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (QGuiApplication::clipboard()->supportsSelection()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue