#include <QtDBus/QDBusInterface>
#endif
-#if defined(Q_OS_X11)
-#include <QX11Info>
-#endif
#include <QQmlEngine>
#include <QQmlComponent>
raiseWidget->showNormal();
raiseWidget->raise();
raiseWidget->activateWindow();
-
-#if defined(Q_OS_X11)
- WId wid = widget->winId();
- NETWM::init();
-
- XEvent e;
- e.xclient.type = ClientMessage;
- e.xclient.message_type = NETWM::NET_ACTIVE_WINDOW;
- e.xclient.display = QX11Info::display();
- e.xclient.window = wid;
- e.xclient.format = 32;
- e.xclient.data.l[0] = 2;
- e.xclient.data.l[1] = QX11Info::appTime();
- e.xclient.data.l[2] = 0;
- e.xclient.data.l[3] = 0l;
- e.xclient.data.l[4] = 0l;
- Display *display = QX11Info::display();
- XSendEvent(display,
- RootWindow(display, DefaultScreen(display)),
- False, // propagate
- SubstructureRedirectMask | SubstructureNotifyMask,
- &e);
-
-#elif defined(Q_OS_WIN)
+#ifdef Q_OS_WIN
// Windows disallows raising a Window when you're not the active application.
// Use a common hack to attach to the active application
const auto activeProcessId = GetWindowThreadProcessId(GetForegroundWindow(), nullptr);