Changeset View
Changeset View
Standalone View
Standalone View
xwl/selection.h
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | |||||
55 | */ | 55 | */ | ||
56 | class Selection : public QObject | 56 | class Selection : public QObject | ||
57 | { | 57 | { | ||
58 | Q_OBJECT | 58 | Q_OBJECT | ||
59 | public: | 59 | public: | ||
60 | static xcb_atom_t mimeTypeToAtom(const QString &mimeType); | 60 | static xcb_atom_t mimeTypeToAtom(const QString &mimeType); | ||
61 | static xcb_atom_t mimeTypeToAtomLiteral(const QString &mimeType); | 61 | static xcb_atom_t mimeTypeToAtomLiteral(const QString &mimeType); | ||
62 | static QStringList atomToMimeTypes(xcb_atom_t atom); | 62 | static QStringList atomToMimeTypes(xcb_atom_t atom); | ||
63 | static void sendSelNotify(xcb_selection_request_event_t *event, bool success); | ||||
63 | 64 | | |||
64 | // on selection owner changes by X clients (Xwl -> Wl) | 65 | // on selection owner changes by X clients (Xwl -> Wl) | ||
65 | bool handleXfixesNotify(xcb_xfixes_selection_notify_event_t *event); | 66 | bool handleXfixesNotify(xcb_xfixes_selection_notify_event_t *event); | ||
66 | bool filterEvent(xcb_generic_event_t *event); | 67 | bool filterEvent(xcb_generic_event_t *event); | ||
67 | void sendSelNotify(xcb_selection_request_event_t *event, bool success); | | |||
68 | 68 | | |||
69 | xcb_atom_t atom() const { | 69 | xcb_atom_t atom() const { | ||
70 | return m_atom; | 70 | return m_atom; | ||
71 | } | 71 | } | ||
72 | xcb_window_t window() const { | 72 | xcb_window_t window() const { | ||
73 | return m_window; | 73 | return m_window; | ||
74 | } | 74 | } | ||
75 | void overwriteRequestorWindow(xcb_window_t window); | ||||
75 | 76 | | |||
76 | Q_SIGNALS: | 77 | Q_SIGNALS: | ||
77 | void transferFinished(xcb_timestamp_t eventTime); | 78 | void transferFinished(xcb_timestamp_t eventTime); | ||
78 | 79 | | |||
79 | protected: | 80 | protected: | ||
80 | Selection(xcb_atom_t atom, QObject *parent); | 81 | Selection(xcb_atom_t atom, QObject *parent); | ||
81 | void registerXfixes(); | 82 | void registerXfixes(); | ||
82 | 83 | | |||
Show All 29 Lines | 106 | private: | |||
112 | 113 | | |||
113 | // Timeout transfers, which have become inactive due to client errors. | 114 | // Timeout transfers, which have become inactive due to client errors. | ||
114 | void timeoutTransfers(); | 115 | void timeoutTransfers(); | ||
115 | void startTimeoutTransfersTimer(); | 116 | void startTimeoutTransfersTimer(); | ||
116 | void endTimeoutTransfersTimer(); | 117 | void endTimeoutTransfersTimer(); | ||
117 | 118 | | |||
118 | xcb_atom_t m_atom = XCB_ATOM_NONE; | 119 | xcb_atom_t m_atom = XCB_ATOM_NONE; | ||
119 | xcb_window_t m_window = XCB_WINDOW_NONE; | 120 | xcb_window_t m_window = XCB_WINDOW_NONE; | ||
121 | xcb_window_t m_requestorWindow = XCB_WINDOW_NONE; | ||||
120 | xcb_timestamp_t m_timestamp; | 122 | xcb_timestamp_t m_timestamp; | ||
121 | 123 | | |||
122 | // Active source, if any. Only one of them at max can exist | 124 | // Active source, if any. Only one of them at max can exist | ||
123 | // at the same time. | 125 | // at the same time. | ||
124 | WlSource *m_wlSrc = nullptr; | 126 | WlSource *m_wlSrc = nullptr; | ||
125 | X11Source *m_xSrc = nullptr; | 127 | X11Source *m_xSrc = nullptr; | ||
126 | 128 | | |||
127 | // active transfers | 129 | // active transfers | ||
Show All 11 Lines |