From 0eefa785a0d8bfe96403f9c13e80544cf8bb8eb3 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Tue, 1 Jul 2014 17:36:15 +0200 Subject: 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 Reviewed-by: Allan Sandfeld Jensen --- src/plugins/platforms/xcb/qxcbnativeinterface.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/plugins/platforms/xcb/qxcbnativeinterface.h') 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); }; -- cgit v1.2.3