summaryrefslogtreecommitdiffstats
path: root/src/widgets/util
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-06-27 12:21:21 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-28 10:58:53 +0200
commit5016615e334c56458ad28d66e227094e3b224901 (patch)
treeb699426bbc976be9cef57368d97672598d3aa810 /src/widgets/util
parentd1a6de21c30f782c80ca66524e650f63417d3b72 (diff)
Fix system tray icon on X11.
Observe Qt::BypassWindowManagerHint in XCB and use it for the tray. Remove the call to XSync(), which sometimes was causing the window to appear in the wrong place for a short time. Task-number: QTBUG-31762 Change-Id: I7b4fc5e42b8c8bb9d03b1575be99d6d1c727be37 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/widgets/util')
-rw-r--r--src/widgets/util/qsystemtrayicon_x11.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
index e04656974d..5204b85a9a 100644
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
@@ -153,16 +153,17 @@ private:
QSystemTrayIcon *q;
};
-QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *qIn) :
- q(qIn)
+QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *qIn)
+ : QWidget(0, Qt::Window | Qt::FramelessWindowHint | Qt::BypassWindowManagerHint)
+ , q(qIn)
{
+ setObjectName(QStringLiteral("QSystemTrayIconSys"));
setToolTip(q->toolTip());
QX11SystemTrayContext *context = qX11SystemTrayContext();
Q_ASSERT(context->isValid());
setAttribute(Qt::WA_AlwaysShowToolTips, true);
setAttribute(Qt::WA_TranslucentBackground, true);
setAttribute(Qt::WA_QuitOnClose, false);
- setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
const QSize size(22, 22); // Gnome, standard size
setGeometry(QRect(QPoint(0, 0), size));
setMinimumSize(size);
@@ -182,7 +183,6 @@ QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *qIn) :
ev.xclient.format = 32;
memcpy((char *)&ev.xclient.data, (const char *) l, sizeof(l));
XSendEvent(display, ev.xclient.window, False, 0, &ev);
- XSync(display, False);
show();
}