From e06d2bc80672776fc4fb0ca8a3861a4f9d493133 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 23 Mar 2011 14:36:43 +0200 Subject: GraphicsViews: Focused widget is not visible after orientation change If there is a graphicsview with input widget focused and splitview is open, and we rotate the device from Portrait to Landscape (or vice versa), the input widget is no longer visible in the splitview rect. This only happens if there are scrollbars visible in the view. Reason is that the input widget is tried to ensure visibility for before window surface is valid. In these cases, make the input widget visibility re-location happen after window server indicates that the view is now visible. Task-number: QTBUG-17576 Reviewed-by: Guoqing Zhang --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 9d8dd41..767b974 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -330,6 +330,21 @@ bool QCoeFepInputContext::symbianFilterEvent(QWidget *keyWidget, const QSymbianE // This should also happen for commands. reset(); + if (event->windowServerEvent() && event->windowServerEvent()->Type() == EEventWindowVisibilityChanged) { + if (S60->splitViewLastWidget) { + QGraphicsView *gv = qobject_cast(S60->splitViewLastWidget); + const bool alwaysResize = (gv && gv->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff); + + if (alwaysResize) { + TUint visibleFlags = event->windowServerEvent()->VisibilityChanged()->iFlags; + if (visibleFlags & TWsVisibilityChangedEvent::EPartiallyVisible) + ensureFocusWidgetVisible(S60->splitViewLastWidget); + if (visibleFlags & TWsVisibilityChangedEvent::ENotVisible) + resetSplitViewWidget(true); + } + } + } + return false; } -- cgit v0.12