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;
|
_selectionType = TextSelectType::Letters;
|
||||||
|
|
||||||
if (activated) {
|
if (activated) {
|
||||||
const auto guard = window();
|
// _clickHandlerFilter may delete `this`. In that case we don't want
|
||||||
if (!_clickHandlerFilter
|
// to try to show a context menu or smth like that.
|
||||||
|| _clickHandlerFilter(activated, button)) {
|
crl::on_main(this, [=] {
|
||||||
ActivateClickHandler(guard, activated, button);
|
const auto guard = window();
|
||||||
}
|
if (!_clickHandlerFilter
|
||||||
|
|| _clickHandlerFilter(activated, button)) {
|
||||||
|
ActivateClickHandler(guard, activated, button);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QGuiApplication::clipboard()->supportsSelection()
|
if (QGuiApplication::clipboard()->supportsSelection()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue