1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Fri, 8 Oct 2010 20:13:40 +0200
Subject: [PATCH] Fix dnd issue on QWS
An overrideCursor set in the application can be messed up by
dnd stuff. As a result, the cursor gets stuck at Qt::ForbiddenCursor
This patch seems to fix it, but I'm not sure if it breaks anything.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
src/gui/kernel/qdnd_qws.cpp | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/gui/kernel/qdnd_qws.cpp b/src/gui/kernel/qdnd_qws.cpp
index a925fdfe1b65..22dd43d31e80 100644
--- a/src/gui/kernel/qdnd_qws.cpp
+++ b/src/gui/kernel/qdnd_qws.cpp
@@ -162,10 +162,10 @@ void QDragManager::updateCursor()
}
} else {
QCursor *overrideCursor = QApplication::overrideCursor();
- if (!overrideCursor || overrideCursor->shape() != Qt::ForbiddenCursor) {
+ if (restoreCursor && (!overrideCursor || overrideCursor->shape() != Qt::ForbiddenCursor)) {
QApplication::changeOverrideCursor(QCursor(Qt::ForbiddenCursor));
- currentActionForOverrideCursor = Qt::IgnoreAction;
}
+ currentActionForOverrideCursor = Qt::IgnoreAction;
if (qt_qws_dnd_deco)
qt_qws_dnd_deco->hide();
}
@@ -246,7 +246,6 @@ bool QDragManager::eventFilter(QObject *o, QEvent *e)
willDrop = false;
global_accepted_action = Qt::IgnoreAction;
updateCursor();
- restoreCursor = true;
object->d_func()->target = 0;
}
if (cw && cw->acceptDrops()) {
@@ -257,7 +256,6 @@ bool QDragManager::eventFilter(QObject *o, QEvent *e)
willDrop = dee.isAccepted() && dee.dropAction() != Qt::IgnoreAction;
global_accepted_action = willDrop ? dee.dropAction() : Qt::IgnoreAction;
updateCursor();
- restoreCursor = true;
}
} else if (cw) {
QDragMoveEvent dme(cw->mapFromGlobal(me->globalPos()), possible_actions, dropData,
@@ -281,8 +279,8 @@ bool QDragManager::eventFilter(QObject *o, QEvent *e)
case QEvent::MouseButtonRelease:
{
qApp->removeEventFilter(this);
+ willDrop = false;
if (restoreCursor) {
- willDrop = false;
#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
#endif
@@ -336,7 +334,6 @@ Qt::DropAction QDragManager::drag(QDrag *o)
willDrop = false;
updatePixmap();
updateCursor();
- restoreCursor = true;
object->d_func()->target = 0;
qApp->installEventFilter(this);
|