Commit dd3746f6 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix ASAN crash when creating a guide

In some places we static_cast our event into QEnterEvent, so
we should prepare a correct object for that.

BUG:405732
parent 5b6915a4
......@@ -299,7 +299,12 @@ bool KisInputManager::Private::CanvasSwitcher::eventFilter(QObject* object, QEve
setupFocusThreshold(object);
focusSwitchThreshold.setEnabled(false);
QEvent event(QEvent::Enter);
const QPoint globalPos = QCursor::pos();
const QPoint localPos = d->canvas->canvasWidget()->mapFromGlobal(globalPos);
QWidget *canvasWindow = d->canvas->canvasWidget()->window();
const QPoint windowsPos = canvasWindow ? canvasWindow->mapFromGlobal(globalPos) : localPos;
QEnterEvent event(localPos, windowsPos, globalPos);
d->q->eventFilter(object, &event);
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment