summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@sosco.com>2009-11-13 15:31:10 (GMT)
committerShane Kearns <shane.kearns@sosco.com>2009-11-13 15:31:10 (GMT)
commitc4dbc1c3feb04efae2734eb9f80735b47bc0d195 (patch)
treefbca560fc62dda53d38f0600363949565389f9e4 /src
parent2950c82bc3681b71742b18c2b315675e2f343cc0 (diff)
downloadQt-c4dbc1c3feb04efae2734eb9f80735b47bc0d195.zip
Qt-c4dbc1c3feb04efae2734eb9f80735b47bc0d195.tar.gz
Qt-c4dbc1c3feb04efae2734eb9f80735b47bc0d195.tar.bz2
Remove fake right mouse button events from long tap
The context menu is launched by a separate event, not by the right mouse button. Generating the fake right mouse button caused side effects. We now treat the touch screen as a one button mouse, long taps still open the context menu using QContextMenuEvent. Task-number: QTBUG-5180 Reviewed-by: axis
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp20
-rw-r--r--src/gui/kernel/qt_s60_p.h1
2 files changed, 1 insertions, 20 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 04e4b31..c7f0c00 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -323,7 +323,6 @@ QSymbianControl::QSymbianControl(QWidget *w)
, qwidget(w)
, m_longTapDetector(0)
, m_ignoreFocusChanged(0)
- , m_previousEventLongTap(0)
, m_symbianPopupIsOpen(0)
{
}
@@ -362,9 +361,6 @@ QSymbianControl::~QSymbianControl()
setFocusSafely(false);
S60->appUi()->RemoveFromStack(this);
delete m_longTapDetector;
-
- if(m_previousEventLongTap)
- QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons & ~Qt::RightButton;
}
void QSymbianControl::setWidget(QWidget *w)
@@ -379,19 +375,11 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons
alienWidget = qwidget->childAt(widgetPos);
if (!alienWidget)
alienWidget = qwidget;
- QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons &(~Qt::LeftButton);
- QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons | Qt::RightButton;
- QMouseEvent mEvent(QEvent::MouseButtonPress, alienWidget->mapFrom(qwidget, widgetPos), globalPos,
- Qt::RightButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier);
-
- bool res = sendMouseEvent(alienWidget, &mEvent);
#if !defined(QT_NO_CONTEXTMENU)
- QContextMenuEvent contextMenuEvent(QContextMenuEvent::Mouse, widgetPos, globalPos, mEvent.modifiers());
+ QContextMenuEvent contextMenuEvent(QContextMenuEvent::Mouse, widgetPos, globalPos, Qt::NoModifier);
qt_sendSpontaneousEvent(alienWidget, &contextMenuEvent);
#endif
-
- m_previousEventLongTap = true;
}
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
@@ -515,12 +503,6 @@ void QSymbianControl::HandlePointerEvent(const TPointerEvent& pEvent)
mapS60MouseEventTypeToQt(&type, &button, &pEvent);
Qt::KeyboardModifiers modifiers = mapToQtModifiers(pEvent.iModifiers);
- if (m_previousEventLongTap)
- if (type == QEvent::MouseButtonRelease){
- button = Qt::RightButton;
- QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons & ~Qt::RightButton;
- m_previousEventLongTap = false;
- }
if (type == QMouseEvent::None)
return;
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index ec8c9cb..08f8bb5 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -204,7 +204,6 @@ private:
QWidget *qwidget;
QLongTapTimer* m_longTapDetector;
bool m_ignoreFocusChanged : 1;
- bool m_previousEventLongTap : 1;
bool m_symbianPopupIsOpen : 1;
#ifdef Q_WS_S60