QNX: Fix focus handling for secondary screen

This patch removes the activaton aand deactivation of a window when we get the window group
activated event from the navigator. This event is sent to both the primary and secondary screen
and does not state if a window should be active from a Qt perspective.
A window should only be active if it has screen keyboard focus.

Change-Id: Ibbed0dd76a21d86f4b580265f996357a8eef5192
Reviewed-by: Roger Maclean <rmaclean@qnx.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
bb10
Fabian Bumberger 2013-12-03 15:18:13 +01:00 committed by The Qt Project
parent e6c8b86b84
commit d56f5df84f
4 changed files with 10 additions and 26 deletions

View File

@ -728,8 +728,6 @@ void QQnxScreen::activateWindowGroup(const QByteArray &id)
if (m_coverWindow)
m_coverWindow->setExposed(false);
QWindowSystemInterface::handleWindowActivated(window);
}
void QQnxScreen::deactivateWindowGroup(const QByteArray &id)
@ -744,8 +742,6 @@ void QQnxScreen::deactivateWindowGroup(const QByteArray &id)
Q_FOREACH (QQnxWindow *childWindow, m_childWindows)
childWindow->setExposed(false);
QWindowSystemInterface::handleWindowActivated(rootWindow()->window());
}
QQnxWindow *QQnxScreen::rootWindow() const

View File

@ -341,10 +341,6 @@ void QQnxScreenEventHandler::handlePointerEvent(screen_event_t event)
}
}
// If we don't have a navigator, we don't get activation events.
if (buttonState && w && w != QGuiApplication::focusWindow() && !m_qnxIntegration->supportsNavigatorEvents())
QWindowSystemInterface::handleWindowActivated(w);
m_lastMouseWindow = qnxWindow;
// Apply scaling to wheel delta and invert value for Qt. We'll probably want to scale
@ -616,9 +612,15 @@ void QQnxScreenEventHandler::handleKeyboardFocusPropertyEvent(screen_window_t wi
if (window && screen_get_window_property_iv(window, SCREEN_PROPERTY_KEYBOARD_FOCUS, &focus) != 0)
qFatal("QQnx: failed to query keyboard focus property, errno=%d", errno);
QWindow *w = focus ? QQnxIntegration::window(window) : 0;
QWindowSystemInterface::handleWindowActivated(w);
QWindow *focusWindow = QQnxIntegration::window(window);
if (focus) {
QWindowSystemInterface::handleWindowActivated(focusWindow);
} else if (focusWindow == QGuiApplication::focusWindow()) {
// Deactivate only if the window was the focus window.
// Screen might send a keyboard focus event for a newly created
// window on the secondary screen, with focus 0.
QWindowSystemInterface::handleWindowActivated(0);
}
}
#include "moc_qqnxscreeneventhandler.cpp"

View File

@ -458,12 +458,7 @@ void QQnxWindow::lower()
void QQnxWindow::requestActivateWindow()
{
qWindowDebug() << Q_FUNC_INFO << "window =" << window();
// TODO: Tell screen to set keyboard focus to this window.
// Notify that we gained focus.
gainedFocus();
// Overwrite the default implementation where the window is activated
}
@ -487,14 +482,6 @@ void QQnxWindow::propagateSizeHints()
qWindowDebug() << Q_FUNC_INFO << ": ignored";
}
void QQnxWindow::gainedFocus()
{
qWindowDebug() << Q_FUNC_INFO << "window =" << window();
// Got focus
QWindowSystemInterface::handleWindowActivated(window());
}
void QQnxWindow::setMMRendererWindowName(const QString &name)
{
m_mmRendererWindowName = name;

View File

@ -93,7 +93,6 @@ public:
void propagateSizeHints();
void gainedFocus();
void setMMRendererWindowName(const QString &name);
void setMMRendererWindow(screen_window_t handle);
void clearMMRendererWindow();