Commit 9292955f authored by Eike Ziller's avatar Eike Ziller Committed by hjk
Browse files

Fix the main window raise workaround for Qt5.1



Change-Id: I17d09c70053661166784657954929ccf3b5366ec
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 116219f3
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include <QEvent> #include <QEvent>
#include <QCoreApplication> #include <QCoreApplication>
#ifdef Q_WS_X11 #ifdef QTC_USE_QX11INFO
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <QX11Info> #include <QX11Info>
#endif #endif
...@@ -63,7 +63,7 @@ void AppMainWindow::raiseWindow() ...@@ -63,7 +63,7 @@ void AppMainWindow::raiseWindow()
raise(); raise();
#if defined(Q_WS_X11) #if defined(QTC_USE_QX11INFO)
// Do the same as QWidget::activateWindow(), but with two differences // Do the same as QWidget::activateWindow(), but with two differences
// * set newest timestamp (instead of userTime()). See QTBUG-24932 // * set newest timestamp (instead of userTime()). See QTBUG-24932
// * set source to 'pager'. This seems to do the trick e.g. on kwin even if // * set source to 'pager'. This seems to do the trick e.g. on kwin even if
...@@ -79,7 +79,7 @@ void AppMainWindow::raiseWindow() ...@@ -79,7 +79,7 @@ void AppMainWindow::raiseWindow()
e.xclient.data.l[2] = None; e.xclient.data.l[2] = None;
e.xclient.data.l[3] = 0; e.xclient.data.l[3] = 0;
e.xclient.data.l[4] = 0; e.xclient.data.l[4] = 0;
XSendEvent(QX11Info::display(), QX11Info::appRootWindow(x11Info().screen()), XSendEvent(QX11Info::display(), QX11Info::appRootWindow(),
false, SubstructureNotifyMask | SubstructureRedirectMask, &e); false, SubstructureNotifyMask | SubstructureRedirectMask, &e);
#else #else
activateWindow(); activateWindow();
......
...@@ -6,6 +6,15 @@ include(utils-lib.pri) ...@@ -6,6 +6,15 @@ include(utils-lib.pri)
lessThan(QT_MAJOR_VERSION, 5) { lessThan(QT_MAJOR_VERSION, 5) {
# Needed for QtCore/private/qwineventnotifier_p.h # Needed for QtCore/private/qwineventnotifier_p.h
win32:include(../../private_headers.pri) win32:include(../../private_headers.pri)
linux-*: DEFINES += QTC_USE_QX11INFO
} else:linux-* {
!isEmpty(QT.x11extras.name) {
QT += x11extras
DEFINES += QTC_USE_QX11INFO
} else {
warning("x11extras module not found, raising the main window might not work. " \
"(The x11extras module is part of Qt 5.1 and later.)")
}
} }
win32: LIBS += -luser32 win32: LIBS += -luser32
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment