summaryrefslogtreecommitdiffstats
path: root/src/widgets/util/qsystemtrayicon_x11.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@theqtcompany.com>2015-02-17 10:08:37 +0100
committerJørgen Lind <jorgen.lind@theqtcompany.com>2015-02-23 13:02:18 +0000
commit7e070d47e30c1ec4b1e4eedc0a3e4c95b47f6311 (patch)
tree733825b27809febc5a273a52e2b46cab05df43b1 /src/widgets/util/qsystemtrayicon_x11.cpp
parentf127176f269b5288e418c7cb58f4da0d93742c3b (diff)
xcb: Expose the systemtray functions through platformheaders
Change-Id: I3504141d8130bbfe3246d81b61c8cbb010e255d6 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/widgets/util/qsystemtrayicon_x11.cpp')
-rw-r--r--src/widgets/util/qsystemtrayicon_x11.cpp26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
index 2b153d53d9..b9b67c1df2 100644
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
@@ -52,6 +52,7 @@
#include <private/qguiapplication_p.h>
#include <qdebug.h>
+#include <QtPlatformHeaders/qxcbwindowfunctions.h>
#ifndef QT_NO_SYSTEMTRAYICON
QT_BEGIN_NAMESPACE
@@ -119,10 +120,7 @@ QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *qIn)
setAttribute(Qt::WA_TranslucentBackground, hasAlphaChannel);
if (!hasAlphaChannel) {
createWinId();
- QMetaObject::invokeMethod(QGuiApplication::platformNativeInterface(),
- "setParentRelativeBackPixmap", Qt::DirectConnection,
- Q_ARG(const QWindow *, windowHandle())
- );
+ QXcbWindowFunctions::setParentRelativeBackPixmap(windowHandle());
// XXX: This is actually required, but breaks things ("QWidget::paintEngine: Should no
// longer be called"). Why is this needed? When the widget is drawn, we use tricks to grab
@@ -143,15 +141,9 @@ bool QSystemTrayIconSys::addToTray()
createWinId();
setMouseTracking(true);
- bool requestResult = false;
- if (!QMetaObject::invokeMethod(QGuiApplication::platformNativeInterface(),
- "requestSystemTrayWindowDock", Qt::DirectConnection,
- Q_RETURN_ARG(bool, requestResult),
- Q_ARG(const QWindow *, windowHandle()))
- || !requestResult) {
- qWarning("requestSystemTrayWindowDock failed.");
+ if (!QXcbWindowFunctions::requestSystemTrayWindowDock(windowHandle()))
return false;
- }
+
if (!background.isNull())
background = QPixmap();
show();
@@ -171,15 +163,7 @@ void QSystemTrayIconSys::systemTrayWindowChanged(QScreen *)
QRect QSystemTrayIconSys::globalGeometry() const
{
- QRect result;
- if (!QMetaObject::invokeMethod(QGuiApplication::platformNativeInterface(),
- "systemTrayWindowGlobalGeometry", Qt::DirectConnection,
- Q_RETURN_ARG(QRect, result),
- Q_ARG(const QWindow *, windowHandle()))
- || !result.isValid()) {
- qWarning("systemTrayWindowGlobalGeometry failed.");
- }
- return result;
+ return QXcbWindowFunctions::systemTrayWindowGlobalGeometry(windowHandle());
}
void QSystemTrayIconSys::mousePressEvent(QMouseEvent *ev)