Defer window activation if the window hasn't beenn mapped yet.

Change-Id: I60d616fc60d3be9b55ab2599abadede5f7c11f93
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Lars Knoll 2012-03-08 12:49:49 +01:00 committed by Qt by Nokia
parent f5b2a09467
commit 3ca1a2c28e
2 changed files with 8 additions and 1 deletions

View File

@ -143,6 +143,7 @@ QXcbWindow::QXcbWindow(QWindow *window)
, m_syncCounter(0)
, m_mapped(false)
, m_transparent(false)
, m_deferredActivation(false)
, m_netWmUserTimeWindow(XCB_NONE)
#if defined(XCB_USE_EGL)
, m_eglSurface(0)
@ -1178,8 +1179,11 @@ void QXcbWindow::propagateSizeHints()
void QXcbWindow::requestActivateWindow()
{
if (!m_mapped)
if (!m_mapped) {
m_deferredActivation = true;
return;
}
m_deferredActivation = false;
updateNetWmUserTime(connection()->time());
@ -1334,6 +1338,8 @@ void QXcbWindow::handleMapNotifyEvent(const xcb_map_notify_event_t *event)
{
if (event->window == m_window) {
m_mapped = true;
if (m_deferredActivation)
requestActivateWindow();
QWindowSystemInterface::handleMapEvent(window());
}
}

View File

@ -154,6 +154,7 @@ private:
bool m_mapped;
bool m_transparent;
bool m_deferredActivation;
xcb_window_t m_netWmUserTimeWindow;
QSurfaceFormat m_format;