From cb530c3336964914fcec26c6ea001122104353ba Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 24 Mar 2010 11:27:11 +0100 Subject: Do not use _NET_ACTIVE_WINDOW for nonmanaged windows. If a window has X11BypassWindowManager hint, we shouldn't bother asking the windowmanager to active it using the _NET_ACTIVE_WINDOW protocol and just go though Xorg directly. Reviewed-by: Bradley T. Hughes --- src/gui/kernel/qwidget_x11.cpp | 3 ++- tests/auto/qshortcut/tst_qshortcut.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index c1363d2..457e92c 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -1642,7 +1642,8 @@ void QWidget::activateWindow() X11->userTime = X11->time; qt_net_update_user_time(tlw, X11->userTime); - if (X11->isSupportedByWM(ATOM(_NET_ACTIVE_WINDOW))) { + if (X11->isSupportedByWM(ATOM(_NET_ACTIVE_WINDOW)) + && !(tlw->windowFlags() & Qt::X11BypassWindowManagerHint)) { XEvent e; e.xclient.type = ClientMessage; e.xclient.message_type = ATOM(_NET_ACTIVE_WINDOW); diff --git a/tests/auto/qshortcut/tst_qshortcut.cpp b/tests/auto/qshortcut/tst_qshortcut.cpp index 39518c5..6df4cc4 100644 --- a/tests/auto/qshortcut/tst_qshortcut.cpp +++ b/tests/auto/qshortcut/tst_qshortcut.cpp @@ -224,10 +224,10 @@ void tst_QShortcut::initTestCase() mainW->setFixedSize( 100, 100 ); mainW->setCentralWidget( edit ); mainW->show(); - mainW->activateWindow(); #ifdef Q_WS_X11 qt_x11_wait_for_window_manager(mainW); #endif + mainW->activateWindow(); QTest::qWait(100); connect( mainW->statusBar(), SIGNAL(messageChanged(const QString&)), this, SLOT(statusMessage(const QString&)) ); -- cgit v0.12