forked from qt-creator/qt-creator
AppMainWindow::raise: Use Qt's activateWindow
The work around doesn't seem to be needed anymore. The case that is described is a Creator hitting a breakpoint, but not being raised. This works for me on both gnome and kde with this workaround removed. Removing the workaround also fixes: Task-number: QTCREATORBUG-13845 Change-Id: I4f751c701a17ee39679b951b9cf7d52a68552d9f Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
@@ -37,11 +37,6 @@
|
||||
#include <QEvent>
|
||||
#include <QCoreApplication>
|
||||
|
||||
#ifdef QTC_USE_QX11INFO
|
||||
#include <X11/Xlib.h>
|
||||
#include <QX11Info>
|
||||
#endif
|
||||
|
||||
namespace Utils {
|
||||
|
||||
/* The notification signal is delayed by using a custom event
|
||||
@@ -64,27 +59,7 @@ void AppMainWindow::raiseWindow()
|
||||
|
||||
raise();
|
||||
|
||||
#if defined(QTC_USE_QX11INFO)
|
||||
// Do the same as QWidget::activateWindow(), but with two differences
|
||||
// * 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
|
||||
// the app currently having focus is 'active' (but we hit a breakpoint).
|
||||
XEvent e;
|
||||
e.xclient.type = ClientMessage;
|
||||
e.xclient.message_type = XInternAtom(QX11Info::display(), "_NET_ACTIVE_WINDOW", 1);
|
||||
e.xclient.display = QX11Info::display();
|
||||
e.xclient.window = winId();
|
||||
e.xclient.format = 32;
|
||||
e.xclient.data.l[0] = 2; // pager!
|
||||
e.xclient.data.l[1] = QX11Info::appTime(); // X11 time!
|
||||
e.xclient.data.l[2] = None;
|
||||
e.xclient.data.l[3] = 0;
|
||||
e.xclient.data.l[4] = 0;
|
||||
XSendEvent(QX11Info::display(), QX11Info::appRootWindow(),
|
||||
false, SubstructureNotifyMask | SubstructureRedirectMask, &e);
|
||||
#else
|
||||
activateWindow();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
@@ -3,17 +3,6 @@ QT += gui network
|
||||
include(../../qtcreatorlibrary.pri)
|
||||
include(utils-lib.pri)
|
||||
|
||||
linux-* {
|
||||
!isEmpty(QT.x11extras.name) {
|
||||
QT += x11extras
|
||||
CONFIG += x11
|
||||
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 -lshell32
|
||||
# PortsGatherer
|
||||
win32: LIBS += -liphlpapi -lws2_32
|
||||
|
||||
Reference in New Issue
Block a user