Changeset View
Changeset View
Standalone View
Standalone View
xwl/selection.cpp
Show All 17 Lines | |||||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "selection.h" | 20 | #include "selection.h" | ||
21 | #include "databridge.h" | 21 | #include "databridge.h" | ||
22 | #include "selection_source.h" | 22 | #include "selection_source.h" | ||
23 | #include "transfer.h" | 23 | #include "transfer.h" | ||
24 | 24 | | |||
25 | #include "atoms.h" | 25 | #include "atoms.h" | ||
26 | #include "client.h" | 26 | #include "x11client.h" | ||
27 | #include "workspace.h" | 27 | #include "workspace.h" | ||
28 | 28 | | |||
29 | #include <xcb/xcb_event.h> | 29 | #include <xcb/xcb_event.h> | ||
30 | #include <xcb/xfixes.h> | 30 | #include <xcb/xfixes.h> | ||
31 | 31 | | |||
32 | #include <QTimer> | 32 | #include <QTimer> | ||
33 | 33 | | |||
34 | namespace KWin | 34 | namespace KWin | ||
▲ Show 20 Lines • Show All 206 Lines • ▼ Show 20 Line(s) | |||||
241 | } | 241 | } | ||
242 | 242 | | |||
243 | bool Selection::handleSelectionRequest(xcb_selection_request_event_t *event) | 243 | bool Selection::handleSelectionRequest(xcb_selection_request_event_t *event) | ||
244 | { | 244 | { | ||
245 | if (event->selection != m_atom) { | 245 | if (event->selection != m_atom) { | ||
246 | return false; | 246 | return false; | ||
247 | } | 247 | } | ||
248 | 248 | | |||
249 | if (qobject_cast<Client *>(workspace()->activeClient()) == nullptr) { | 249 | if (qobject_cast<X11Client *>(workspace()->activeClient()) == nullptr) { | ||
250 | // Receiving Wayland selection not allowed when no Xwayland surface active | 250 | // Receiving Wayland selection not allowed when no Xwayland surface active | ||
251 | // filter the event, but don't act upon it | 251 | // filter the event, but don't act upon it | ||
252 | sendSelectionNotify(event, false); | 252 | sendSelectionNotify(event, false); | ||
253 | return true; | 253 | return true; | ||
254 | } | 254 | } | ||
255 | 255 | | |||
256 | if (m_window != event->owner || !m_waylandSource) { | 256 | if (m_window != event->owner || !m_waylandSource) { | ||
257 | if (event->time < m_timestamp) { | 257 | if (event->time < m_timestamp) { | ||
▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines |