Comment 56 for bug 799202

Revision history for this message
Jean-Baptiste Mardelle (jb-kdenlive) wrote :

I had a look at the Krita sources, as pointed out by Jussi, and the problem does not come from the kis_canvas_controller code, but seems to come from kis_canvas_widget_base.cpp.

There, we have the following code:

void KisCanvasWidgetBase::processTabletEvent(QTabletEvent *e)
{
    widget()->setFocus(Qt::OtherFocusReason);
    m_d->blockMouseEvent.start(100);

    const QPointF pos = e->hiResGlobalPos() - widget()->mapToGlobal(QPoint(0, 0));
    m_d->toolProxy->tabletEvent(e, m_d->coordinatesConverter->widgetToDocument(pos));

    // HACK
    e->ignore();
    m_d->ignorenextMouseEventExceptRightMiddleClick = true;
    // HACK
}

My debugging shows that the problem is in the Qt hiResGlobalPos method from QTabletEvent.

event->pos() seems to give correct results for the QTabletEvent, but
event->hiResGlobalPos() sometimes gives strange results that cause the random lines.

For exemple, I have the following values from hiResGlobalPos (the x coordinate):

(...)
453.731
453.682
453.779
12.4536 <--- weird value
453.633
453.487
(...)

So my guess is that Qt has problem getting the correct values for this hiResGlobalPos, if anybody with a better inside knowledge of Qt can have a look...