From 21eca49954afb0d98d616d475c1c09ca00606af8 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 9 Dec 2011 11:07:01 +0200 Subject: Symbian: Fix double deletion of selected text when using predictive The selected text replacement was done incorrectly, leading to removal of additional text equal to the lenght of the original selection. Fixed by not doing any explicit replacement, but instead faking a preedit character that is immediately removed, which triggers selected text removal in the input method handling of the underlying edit control. Task-number: ou1cimx1#938665 Reviewed-by: Sami Merila --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 26 +++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 3bcac62..02bc4d0 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -1388,15 +1388,25 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText, // but FEP requires that selected text is always removed at StartFepInlineEditL. // Let's remove the selected text if aInitialInlineText is empty and there is selected text if (m_preeditString.isEmpty()) { - int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt(); - int cursorPos = w->inputMethodQuery(Qt::ImCursorPosition).toInt(); - int replacementLength = qAbs(cursorPos-anchor); - if (replacementLength > 0) { - int replacementStart = cursorPos < anchor ? 0 : -replacementLength; - QList clearSelectionAttributes; - QInputMethodEvent clearSelectionEvent(QLatin1String(""), clearSelectionAttributes); - clearSelectionEvent.setCommitString(QLatin1String(""), replacementStart, replacementLength); + QString currentSelection = w->inputMethodQuery(Qt::ImCurrentSelection).toString(); + if (!currentSelection.isEmpty()) { + // To correctly remove selection in cases where we have multiple lines selected, + // we must rely on the control's own selection removal mechanism, as surrounding + // text contains only one line. It's also impossible to accurately detect + // these overselection cases as the anchor and cursor positions are limited to the + // surrounding text. + // Solution is to clear the selection by faking a preedit. Use a dummy character + // from the current selection just to be safe. + QString dummyText = currentSelection.left(1); + QList attributes; + QInputMethodEvent clearSelectionEvent(dummyText, attributes); + clearSelectionEvent.setCommitString(QLatin1String(""), 0, 0); sendEvent(clearSelectionEvent); + + // Now that selection is taken care of, clear the fake preedit. + QInputMethodEvent clearPreeditEvent(QLatin1String(""), attributes); + clearPreeditEvent.setCommitString(QLatin1String(""), 0, 0); + sendEvent(clearPreeditEvent); } } -- cgit v0.12 From 5fbd3e1aacf789cc46fef57d8726333ee8a00e03 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 9 Dec 2011 12:12:28 +0200 Subject: Symbian: Fix a case sensitivity issue with QMAKE_EXTRA_COMPILERS The case of the drive letter generated to the absolute paths seems to have changed between 4.7 and 4.8, which led into regression with projects that utilize $$PWD in target name, as that still returns the path with drive letter in same case as previously. Fixed the critical check to be case insensitive in windows. Task-number: ou1cimx1#951456 Reviewed-by: Murray Read --- qmake/generators/symbian/symmake_sbsv2.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index cc32f8d..5077be5 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -650,7 +650,11 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t foreach(QString targetItem, project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + item)) { // Make sure targetpath is absolute QString absoluteTarget = QDir::cleanPath(outputDir.absoluteFilePath(targetItem)); +#if defined(Q_OS_WIN) + if (allPreDeps.contains(absoluteTarget, Qt::CaseInsensitive)) { +#else if (allPreDeps.contains(absoluteTarget)) { +#endif QStringList deps = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + item + targetItem); QString commandItem = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + item + targetItem).join(" "); -- cgit v0.12 From 54613aec3bdac668d198923814873a9e622ad675 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Fri, 9 Dec 2011 14:40:29 +0200 Subject: Fix window surface config on OpenGL graphics system. QtOpenGL uses 16-bit configs by default but on Symbian it should use 32-bit config. Task-number: QTBUG-23082 Task-number: ou1cimx1#951223 Reviewed-by: Murray Read --- src/opengl/qgl_egl.cpp | 20 ++++++++++++++++++++ src/opengl/qgl_symbian.cpp | 21 +++++++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp index 0b96350..21047d7 100644 --- a/src/opengl/qgl_egl.cpp +++ b/src/opengl/qgl_egl.cpp @@ -64,6 +64,25 @@ void qt_eglproperties_set_glformat(QEglProperties& eglProperties, const QGLForma int stencilSize = glFormat.stencilBufferSize(); int sampleCount = glFormat.samples(); +#ifdef Q_OS_SYMBIAN + // on Symbian we prefer 32-bit configs + if (glFormat.alpha() && alphaSize <= 0) + alphaSize = 8; + if (glFormat.depth() && depthSize <= 0) + depthSize = 24; + if (glFormat.stencil() && stencilSize <= 0) + stencilSize = 8; + if (glFormat.sampleBuffers() && sampleCount <= 0) + sampleCount = 1; + + redSize = redSize > 0 ? redSize : 8; + greenSize = greenSize > 0 ? greenSize : 8; + blueSize = blueSize > 0 ? blueSize : 8; + alphaSize = alphaSize > 0 ? alphaSize : 8; + depthSize = depthSize > 0 ? depthSize : 24; + stencilSize = stencilSize > 0 ? stencilSize : 8; + sampleCount = sampleCount > 0 ? sampleCount : 4; +#else // QGLFormat uses a magic value of -1 to indicate "don't care", even when a buffer of that // type has been requested. So we must check QGLFormat's booleans too if size is -1: if (glFormat.alpha() && alphaSize <= 0) @@ -101,6 +120,7 @@ void qt_eglproperties_set_glformat(QEglProperties& eglProperties, const QGLForma depthSize = depthSize > 0 ? depthSize : 0; stencilSize = stencilSize > 0 ? stencilSize : 0; sampleCount = sampleCount > 0 ? sampleCount : 0; +#endif eglProperties.setValue(EGL_RED_SIZE, redSize); eglProperties.setValue(EGL_GREEN_SIZE, greenSize); diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp index 0148304..7d343f6 100644 --- a/src/opengl/qgl_symbian.cpp +++ b/src/opengl/qgl_symbian.cpp @@ -181,14 +181,19 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) // almost same as d->ownsEglContext = true; d->eglContext->setApi(QEgl::OpenGL); - // Allow apps to override ability to use multisampling by setting an environment variable. Eg: - // qputenv("QT_SYMBIAN_DISABLE_GL_MULTISAMPLE", "1"); - // Added to allow camera app to start with limited memory. - if (!QSymbianGraphicsSystemEx::hasBCM2727() && !qgetenv("QT_SYMBIAN_DISABLE_GL_MULTISAMPLE").toInt()) { - // Most likely we have hw support for multisampling - // so let's enable it. - d->glFormat.setSampleBuffers(1); - d->glFormat.setSamples(4); + if (d->glFormat.samples() == EGL_DONT_CARE) { + // Allow apps to override ability to use multisampling by setting an environment variable. Eg: + // qputenv("QT_SYMBIAN_DISABLE_GL_MULTISAMPLE", "1"); + // Added to allow camera app to start with limited memory. + if (!QSymbianGraphicsSystemEx::hasBCM2727() && !qgetenv("QT_SYMBIAN_DISABLE_GL_MULTISAMPLE").toInt()) { + // Most likely we have hw support for multisampling + // so let's enable it. + d->glFormat.setSampleBuffers(1); + d->glFormat.setSamples(4); + } else { + d->glFormat.setSampleBuffers(0); + d->glFormat.setSamples(1); + } } // If the device is a widget with WA_TranslucentBackground set, make sure the glFormat -- cgit v0.12