diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-06-27 12:21:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-28 10:58:53 +0200 |
commit | 5016615e334c56458ad28d66e227094e3b224901 (patch) | |
tree | b699426bbc976be9cef57368d97672598d3aa810 /src | |
parent | d1a6de21c30f782c80ca66524e650f63417d3b72 (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')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 2 | ||||
-rw-r--r-- | src/widgets/util/qsystemtrayicon_x11.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index b9a2b0d37b..3a19788316 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -239,7 +239,7 @@ void QXcbWindow::create() // XCB_CW_BACK_PIXMAP XCB_NONE, // XCB_CW_OVERRIDE_REDIRECT - type == Qt::Popup || type == Qt::ToolTip, + type == Qt::Popup || type == Qt::ToolTip || (window()->flags() & Qt::BypassWindowManagerHint), // XCB_CW_SAVE_UNDER type == Qt::Popup || type == Qt::Tool || type == Qt::SplashScreen || type == Qt::ToolTip || type == Qt::Drawer, // XCB_CW_EVENT_MASK 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(); } |