diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp index 6c11e121c829355bb0ebc7e81ae3151e4db5d904..d84f3229b299ad6a8d0356722f482948235ac594 100644 --- a/src/declarative/items/qsgcanvas.cpp +++ b/src/declarative/items/qsgcanvas.cpp @@ -70,9 +70,10 @@ DEFINE_BOOL_CONFIG_OPTION(qmlNoThreadedRenderer, QML_BAD_GUI_RENDER_LOOP) extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha); -void QSGCanvasRenderLoop::updateFocusItemTransform() +void QSGCanvasPrivate::updateFocusItemTransform() { - QSGItem *focus = renderer->activeFocusItem(); + Q_Q(QSGCanvas); + QSGItem *focus = q->activeFocusItem(); if (focus && qApp->inputPanel()->inputItem() == focus) qApp->inputPanel()->setInputItemTransform(QSGItemPrivate::get(focus)->itemToCanvasTransform()); } @@ -92,7 +93,7 @@ public: virtual void paint() { if (animationRunning && animationDriver()) animationDriver()->advance(); - updateFocusItemTransform(); + polishItems(); syncSceneGraph(); makeCurrent(); glViewport(0, 0, size.width(), size.height()); @@ -387,6 +388,7 @@ void QSGCanvasPrivate::polishItems() QSGItemPrivate::get(item)->polishScheduled = false; item->updatePolish(); } + updateFocusItemTransform(); } @@ -2037,7 +2039,6 @@ void QSGCanvasRenderThread::sync(bool guiAlreadyLocked) renderThreadAwakened = false; polishItems(); - updateFocusItemTransform(); wake(); wait(); diff --git a/src/declarative/items/qsgcanvas_p.h b/src/declarative/items/qsgcanvas_p.h index b0c63f0d0112ed71346c7a5860ad4cdb96bc7759..d73c57d4568d78f2a0a154b47e49b8697af43d49 100644 --- a/src/declarative/items/qsgcanvas_p.h +++ b/src/declarative/items/qsgcanvas_p.h @@ -131,6 +131,7 @@ public: void notifyFocusChangesRecur(QSGItem **item, int remaining); void updateInputMethodData(); + void updateFocusItemTransform(); void dirtyItem(QSGItem *); void cleanup(QSGNode *); @@ -205,7 +206,6 @@ protected: void renderSceneGraph(const QSize &size) { d->renderSceneGraph(size); } void polishItems() { d->polishItems(); } QAnimationDriver *animationDriver() const { return d->animationDriver; } - void updateFocusItemTransform(); inline QOpenGLContext *glContext() const { return gl; } void createGLContext();