Skip to content

Commit 23e4b78

Browse files
Lauri MalmiPasi Pentikäinen
Lauri Malmi
authored and
Pasi Pentikäinen
committed
Symbian: inputcontext reports pointer events to FEP during inline edit
QCoeFepInputContext::mouseHandler() must report pointer events to FEP by calling CAknExtendedInputCapabilities::ReportEventL( CAknExtendedInputCapabilities::MAknEventObserver:: EPointerEventReceived). Based on this event FEP commits inline edit properly and sends notification peninputserver/VKB. Earlier QCoeFepInputContext:: mouseHandler() called CCoeFep::CancelTransaction() direclty which lead to inconsistent inline edit state between FEP and VKB. Task-number: ou1cimx1#991638 Change-Id: I90641ffd5aed97b27f2ca2328c0296e14b12f319 Reviewed-by: Pasi Pentikäinen <[email protected]> (cherry picked from commit 11a1383) Reviewed-by: Lauri Malmi <[email protected]>
1 parent ab1c27d commit 23e4b78

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

src/gui/inputmethod/inputmethod.pri

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ mac:!embedded:!qpa {
2626
symbian:contains(QT_CONFIG, s60) {
2727
HEADERS += inputmethod/qcoefepinputcontext_p.h
2828
SOURCES += inputmethod/qcoefepinputcontext_s60.cpp
29-
LIBS += -lfepbase -lakninputlanguage
29+
LIBS += -lfepbase -lakninputlanguage -leikctl
3030
}
3131

src/gui/inputmethod/qcoefepinputcontext_p.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
#include <aknedsts.h>
6666
#include <eikccpu.h>
6767

68+
class CAknExtendedInputCapabilities;
69+
6870
QT_BEGIN_NAMESPACE
6971

7072
class QCoeFepInputMaskHandler
@@ -221,6 +223,8 @@ private slots:
221223
QPointer<QWidget> m_lastFocusedEditor;
222224
QPointer<QObject> m_lastFocusedObject;
223225

226+
CAknExtendedInputCapabilities *m_extendedInputCapabilities;
227+
224228
friend class tst_QInputContext;
225229
};
226230

src/gui/inputmethod/qcoefepinputcontext_s60.cpp

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#include <coeinput.h>
6464
#include <w32std.h>
6565
#include <akndiscreetpopup.h>
66+
#include <aknextendedinputcapabilities.h>
6667

6768
#include <qtextedit.h>
6869
#include <qplaintextedit.h>
@@ -432,7 +433,8 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
432433
m_splitViewResizeBy(0),
433434
m_splitViewPreviousWindowStates(Qt::WindowNoState),
434435
m_splitViewPreviousFocusItem(0),
435-
m_ccpu(0)
436+
m_ccpu(0),
437+
m_extendedInputCapabilities(0)
436438
{
437439
m_fepState->SetObjectProvider(this);
438440
int defaultFlags = EAknEditorFlagDefault;
@@ -464,6 +466,8 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
464466
pasteLabel = qt_TDesC2QString(*pasteBuf);
465467
CleanupStack::PopAndDestroy(pasteBuf);
466468
}
469+
470+
m_extendedInputCapabilities = CAknExtendedInputCapabilities::NewL();
467471
)
468472

469473
m_copyAction = new QAction(copyLabel, QApplication::desktop());
@@ -486,6 +490,7 @@ QCoeFepInputContext::~QCoeFepInputContext()
486490

487491
delete m_fepState;
488492
delete m_ccpu;
493+
delete m_extendedInputCapabilities;
489494
}
490495

491496
void QCoeFepInputContext::reset()
@@ -907,7 +912,22 @@ void QCoeFepInputContext::mouseHandler(int x, QMouseEvent *event)
907912
&& (x > 0 && x < m_preeditString.length())) {
908913
m_pointerHandler->HandlePointerEventInInlineTextL(TPointerEvent::EButton1Up, 0, 0);
909914
} else {
910-
commitCurrentString(true);
915+
// Notify FEP about pointer event via CAknExtendedInputCapabilities::ReporEventL().
916+
// FEP will then commit the string and cancel inline edit state properly.
917+
// FEP does not really use the pointer event parameter, so it is ok to pass NULL.
918+
if (m_extendedInputCapabilities) {
919+
TRAP_IGNORE(
920+
m_extendedInputCapabilities->ReportEventL(
921+
CAknExtendedInputCapabilities::MAknEventObserver::EPointerEventReceived,
922+
NULL));
923+
} else {
924+
// In practice m_extendedInputCapabilities should always exist.
925+
// If it does not, commit current string directly here.
926+
// This will cancel inline edit in FEP but VKB might still think that
927+
// inline edit is ongoing.
928+
commitCurrentString(true);
929+
}
930+
911931
int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
912932

913933
QList<QInputMethodEvent::Attribute> attributes;
@@ -924,7 +944,9 @@ TCoeInputCapabilities QCoeFepInputContext::inputCapabilities()
924944
return TCoeInputCapabilities(TCoeInputCapabilities::ENone, 0, 0);
925945
}
926946

927-
return TCoeInputCapabilities(m_textCapabilities, this, 0);
947+
TCoeInputCapabilities inputCapabilities(m_textCapabilities, this, 0);
948+
inputCapabilities.SetObjectProvider(this);
949+
return inputCapabilities;
928950
}
929951

930952
void QCoeFepInputContext::resetSplitViewWidget(bool keepInputWidget)
@@ -2115,8 +2137,12 @@ void QCoeFepInputContext::paste()
21152137
QT_TRAP_THROWING(CcpuPasteL());
21162138
}
21172139

2118-
TTypeUid::Ptr QCoeFepInputContext::MopSupplyObject(TTypeUid /*id*/)
2140+
TTypeUid::Ptr QCoeFepInputContext::MopSupplyObject(TTypeUid id)
21192141
{
2142+
if (m_extendedInputCapabilities
2143+
&& id.iUid == CAknExtendedInputCapabilities::ETypeId)
2144+
return id.MakePtr(m_extendedInputCapabilities);
2145+
21202146
return TTypeUid::Null();
21212147
}
21222148

0 commit comments

Comments
 (0)