From b09d601261244395450557187adeed6717f25155 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Fri, 18 May 2012 11:13:03 +0100 Subject: QNX: Special case z-ordering of the QDesktopWidget window The assumption that window creation order implies correct initial z-ordering is broken when dealing with certain window types. In this commit we special case the QDesktopWidget's window which maybe created after normal application windows yet still need to be layered below them. Without this fix we may accidentaly activate the Desktop window when the blackberry navigator service sends an event to activate the window group. That results in broken focus handling. Change-Id: I42dfde2efb4a0011e37e7bd2e7c5442590606a24 Reviewed-by: Kevin Krammer Reviewed-by: Kevin Ottens Reviewed-by: Giuseppe D'Angelo --- src/plugins/platforms/qnx/qqnxscreen.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index 25a1204b6f..ac0d552d90 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -210,7 +210,17 @@ void QQnxScreen::addWindow(QQnxWindow *window) if (m_childWindows.contains(window)) return; - m_childWindows.push_back(window); + // Ensure that the desktop window is at the bottom of the zorder. + // If we do not do this then we may end up activating the desktop + // when the navigator service gets an event that our window group + // has been activated (see QQnxScreen::activateWindowGroup()). + // Such a situation would strangely break focus handling due to the + // invisible desktop widget window being layered on top of normal + // windows + if (window->window()->windowType() == Qt::Desktop) + m_childWindows.push_front(window); + else + m_childWindows.push_back(window); updateHierarchy(); } -- cgit v1.2.3