1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QXCBSYSTEMTRAYTRACKER_H |
5 | #define QXCBSYSTEMTRAYTRACKER_H |
6 | |
7 | #include "qxcbconnection.h" |
8 | |
9 | #include <xcb/xcb.h> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | class QXcbConnection; |
14 | class QScreen; |
15 | |
16 | class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener |
17 | { |
18 | Q_OBJECT |
19 | public: |
20 | static QXcbSystemTrayTracker *create(QXcbConnection *connection); |
21 | |
22 | xcb_window_t trayWindow(); |
23 | void requestSystemTrayWindowDock(xcb_window_t window) const; |
24 | |
25 | void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); |
26 | |
27 | void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; |
28 | |
29 | xcb_visualid_t visualId(); |
30 | signals: |
31 | void systemTrayWindowChanged(QScreen *screen); |
32 | |
33 | private: |
34 | explicit QXcbSystemTrayTracker(QXcbConnection *connection, |
35 | xcb_atom_t trayAtom, |
36 | xcb_atom_t selection); |
37 | |
38 | void emitSystemTrayWindowChanged(); |
39 | xcb_visualid_t netSystemTrayVisual(); |
40 | |
41 | const xcb_atom_t m_selection; |
42 | const xcb_atom_t m_trayAtom; |
43 | QXcbConnection *m_connection; |
44 | xcb_window_t m_trayWindow = 0; |
45 | }; |
46 | |
47 | QT_END_NAMESPACE |
48 | |
49 | #endif // QXCBSYSTEMTRAYTRACKER_H |
50 |