@@ -32,42 +32,18 @@ GenericApp::GenericApp(const QString& name,
32 : MirSurfaceItem(name, type, state, screenshot, qmlFilePath, parent)
32 : MirSurfaceItem(name, type, state, screenshot, qmlFilePath, parent)
33 , m_touchPressCount(0)
33 , m_touchPressCount(0)
34 , m_touchReleaseCount(0)
34 , m_touchReleaseCount(0)
35− , m_requestedInputMethod(false)
37− connect(this, &QQuickItem::activeFocusChanged,
38− this, &GenericApp::onActiveFocusChanged);
41GenericApp::~GenericApp()
38GenericApp::~GenericApp()
45−void GenericApp::onActiveFocusChanged()
47− if (hasActiveFocus()) {
48− if (m_requestedInputMethod) {
49− Q_EMIT inputMethodRequested();
52− Q_EMIT inputMethodDismissed();
56void GenericApp::touchEvent(QTouchEvent * event)
42void GenericApp::touchEvent(QTouchEvent * event)
58 if (event->touchPointStates() & Qt::TouchPointPressed) {
44 if (event->touchPointStates() & Qt::TouchPointPressed) {
59 ++m_touchPressCount;
45 ++m_touchPressCount;
60 Q_EMIT touchPressCountChanged(m_touchPressCount);
46 Q_EMIT touchPressCountChanged(m_touchPressCount);
62− if (hasActiveFocus()) {
63− if (m_requestedInputMethod) {
64− Q_EMIT inputMethodDismissed();
66− Q_EMIT inputMethodRequested();
68− m_requestedInputMethod = !m_requestedInputMethod;
71 } else if (event->touchPointStates() & Qt::TouchPointReleased) {
47 } else if (event->touchPointStates() & Qt::TouchPointReleased) {
72 ++m_touchReleaseCount;
48 ++m_touchReleaseCount;
73 Q_EMIT touchReleaseCountChanged(m_touchReleaseCount);
49 Q_EMIT touchReleaseCountChanged(m_touchReleaseCount);