diff options
Diffstat (limited to 'recipes-qt/qt5/qtdeclarative/0003-fix-memory-leak-in-QQuickWindowPrivate-deliverTouchA.patch')
-rw-r--r-- | recipes-qt/qt5/qtdeclarative/0003-fix-memory-leak-in-QQuickWindowPrivate-deliverTouchA.patch | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/recipes-qt/qt5/qtdeclarative/0003-fix-memory-leak-in-QQuickWindowPrivate-deliverTouchA.patch b/recipes-qt/qt5/qtdeclarative/0003-fix-memory-leak-in-QQuickWindowPrivate-deliverTouchA.patch deleted file mode 100644 index 79a48f54..00000000 --- a/recipes-qt/qt5/qtdeclarative/0003-fix-memory-leak-in-QQuickWindowPrivate-deliverTouchA.patch +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | From 6aa9001064c19e75e58c830eedc583e2342a7f20 Mon Sep 17 00:00:00 2001 | ||
2 | From: Shawn Rutledge <shawn.rutledge@qt.io> | ||
3 | Date: Wed, 1 Feb 2017 12:06:26 +0100 | ||
4 | Subject: [PATCH 3/3] fix memory leak in | ||
5 | QQuickWindowPrivate::deliverTouchAsMouse | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | A QTouchEvent is allocated with a reduced subset of TouchPoints for | ||
11 | each Item to which we attempt to deliver it, and thrown away afterwards. | ||
12 | (Ιt's not efficient to heap-allocate it, but we can't avoid doing it | ||
13 | at all without changing behavior.) So now it's stored in a QScopedPointer. | ||
14 | |||
15 | Change-Id: I48badb493610d0a715e582a2eedae95e2006eb2b | ||
16 | Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> | ||
17 | Signed-off-by: Gordan Markuš <gordan.markus@pelagicore.com> | ||
18 | --- | ||
19 | src/quick/items/qquickwindow.cpp | 14 +++++++------- | ||
20 | 1 file changed, 7 insertions(+), 7 deletions(-) | ||
21 | |||
22 | diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp | ||
23 | index 1297dde..c130aec 100644 | ||
24 | --- a/src/quick/items/qquickwindow.cpp | ||
25 | +++ b/src/quick/items/qquickwindow.cpp | ||
26 | @@ -629,8 +629,8 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve | ||
27 | |||
28 | // FIXME: make this work for mouse events too and get rid of the asTouchEvent in here. | ||
29 | Q_ASSERT(pointerEvent->asPointerTouchEvent()); | ||
30 | - QTouchEvent *event = pointerEvent->asPointerTouchEvent()->touchEventForItem(item); | ||
31 | - if (!event) | ||
32 | + QScopedPointer<QTouchEvent> event(pointerEvent->asPointerTouchEvent()->touchEventForItem(item)); | ||
33 | + if (event.isNull()) | ||
34 | return false; | ||
35 | |||
36 | // For each point, check if it is accepted, if not, try the next point. | ||
37 | @@ -647,7 +647,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve | ||
38 | break; | ||
39 | |||
40 | qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << p.id() << "->" << item; | ||
41 | - QScopedPointer<QMouseEvent> mousePress(touchToMouseEvent(QEvent::MouseButtonPress, p, event, item, false)); | ||
42 | + QScopedPointer<QMouseEvent> mousePress(touchToMouseEvent(QEvent::MouseButtonPress, p, event.data(), item, false)); | ||
43 | |||
44 | // Send a single press and see if that's accepted | ||
45 | QCoreApplication::sendEvent(item, mousePress.data()); | ||
46 | @@ -661,7 +661,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve | ||
47 | pointerEventPoint->setGrabber(item); | ||
48 | |||
49 | if (checkIfDoubleClicked(event->timestamp())) { | ||
50 | - QScopedPointer<QMouseEvent> mouseDoubleClick(touchToMouseEvent(QEvent::MouseButtonDblClick, p, event, item, false)); | ||
51 | + QScopedPointer<QMouseEvent> mouseDoubleClick(touchToMouseEvent(QEvent::MouseButtonDblClick, p, event.data(), item, false)); | ||
52 | QCoreApplication::sendEvent(item, mouseDoubleClick.data()); | ||
53 | event->setAccepted(mouseDoubleClick->isAccepted()); | ||
54 | if (!mouseDoubleClick->isAccepted()) { | ||
55 | @@ -678,7 +678,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve | ||
56 | } else if (touchMouseDevice == device && p.id() == touchMouseId) { | ||
57 | if (p.state() & Qt::TouchPointMoved) { | ||
58 | if (QQuickItem *mouseGrabberItem = q->mouseGrabberItem()) { | ||
59 | - QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseMove, p, event, mouseGrabberItem, false)); | ||
60 | + QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseMove, p, event.data(), mouseGrabberItem, false)); | ||
61 | QCoreApplication::sendEvent(item, me.data()); | ||
62 | event->setAccepted(me->isAccepted()); | ||
63 | if (me->isAccepted()) { | ||
64 | @@ -689,7 +689,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve | ||
65 | // no grabber, check if we care about mouse hover | ||
66 | // FIXME: this should only happen once, not recursively... I'll ignore it just ignore hover now. | ||
67 | // hover for touch??? | ||
68 | - QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseMove, p, event, item, false)); | ||
69 | + QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseMove, p, event.data(), item, false)); | ||
70 | if (lastMousePosition.isNull()) | ||
71 | lastMousePosition = me->windowPos(); | ||
72 | QPointF last = lastMousePosition; | ||
73 | @@ -707,7 +707,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve | ||
74 | } else if (p.state() & Qt::TouchPointReleased) { | ||
75 | // currently handled point was released | ||
76 | if (QQuickItem *mouseGrabberItem = q->mouseGrabberItem()) { | ||
77 | - QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseButtonRelease, p, event, mouseGrabberItem, false)); | ||
78 | + QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseButtonRelease, p, event.data(), mouseGrabberItem, false)); | ||
79 | QCoreApplication::sendEvent(item, me.data()); | ||
80 | |||
81 | if (item->acceptHoverEvents() && p.screenPos() != QGuiApplicationPrivate::lastCursorPosition) { | ||
82 | -- | ||
83 | 2.9.3 | ||
84 | |||