summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbnativeinterface.h
diff options
context:
space:
mode:
authorLeo Franchi <lfranchi@dropbox.com>2014-07-01 17:36:15 +0200
committerLeonardo Franchi <lfranchi@dropbox.com>2014-07-04 15:32:45 +0200
commit0eefa785a0d8bfe96403f9c13e80544cf8bb8eb3 (patch)
tree738be91ded23632a42cea8af102978fa60e1a06e /src/plugins/platforms/xcb/qxcbnativeinterface.h
parent6577ac381e73b2ce3d57d2e8a39edb424ce9a52d (diff)
Support transparency in qt5 system tray icons, regardless of tray visual
This ports the Qt4 method of supporting the system tray window visual that has an alpha channel as well as ones that do not. We detect whether or not we have a 32-bit format and either use a Qt::transparent background, or call xcb_clear_region before painting the icon. [ChangeLog][Linux/XCB] Fix transparency of tray icons in cases where there is no alpha channel or system tray visual. Task-number: QTBUG-35832 Change-Id: I43d500c39846d2916dd39f8c47c8d85e59b49cae Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbnativeinterface.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index f860e0d267..ff5f358298 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -107,6 +107,8 @@ public:
Q_INVOKABLE void beep();
Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const;
+ Q_INVOKABLE void clearRegion(const QWindow *qwindow, const QRect& rect);
+ Q_INVOKABLE bool systrayVisualHasAlphaChannel();
Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window);
Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window);
@@ -114,8 +116,13 @@ signals:
void systemTrayWindowChanged(QScreen *screen);
private:
+ xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen);
+
const QByteArray m_genericEventFilterType;
+ xcb_atom_t m_sysTraySelectionAtom;
+ xcb_visualid_t m_systrayVisualId;
+
static QXcbScreen *qPlatformScreenForWindow(QWindow *window);
};