From 387f7467684aced939308d759521f1c0d2bc8eb3 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Wed, 15 Apr 2015 13:37:09 +0200 Subject: [PATCH] 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 Reviewed-by: Kai Koehne --- src/libs/utils/appmainwindow.cpp | 25 ------------------------- src/libs/utils/utils.pro | 11 ----------- 2 files changed, 36 deletions(-) diff --git a/src/libs/utils/appmainwindow.cpp b/src/libs/utils/appmainwindow.cpp index 51c7848abdd..155a33ab1eb 100644 --- a/src/libs/utils/appmainwindow.cpp +++ b/src/libs/utils/appmainwindow.cpp @@ -37,11 +37,6 @@ #include #include -#ifdef QTC_USE_QX11INFO -#include -#include -#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 diff --git a/src/libs/utils/utils.pro b/src/libs/utils/utils.pro index b857dc9b24d..2016bcbd4b1 100644 --- a/src/libs/utils/utils.pro +++ b/src/libs/utils/utils.pro @@ -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