diff --git a/xwl/databridge.cpp b/xwl/databridge.cpp index 248ff38c23..3badcea75a 100644 --- a/xwl/databridge.cpp +++ b/xwl/databridge.cpp @@ -10,7 +10,6 @@ #include "clipboard.h" #include "dnd.h" #include "selection.h" -#include "xcbutils.h" #include "xwayland.h" #include "abstract_client.h" @@ -92,29 +91,9 @@ bool DataBridge::filterEvent(xcb_generic_event_t *event) if (m_dnd && m_dnd->filterEvent(event)) { return true; } - if (event->response_type == Xcb::Extensions::self()->fixesSelectionNotifyEvent()) { - return handleXfixesNotify((xcb_xfixes_selection_notify_event_t *)event); - } return false; } -bool DataBridge::handleXfixesNotify(xcb_xfixes_selection_notify_event_t *event) -{ - Selection *selection = nullptr; - - if (event->selection == atoms->clipboard) { - selection = m_clipboard; - } else if (event->selection == atoms->xdnd_selection) { - selection = m_dnd; - } - - if (!selection) { - return false; - } - - return selection->handleXfixesNotify(event); -} - DragEventReply DataBridge::dragMoveFilter(Toplevel *target, const QPoint &pos) { if (!m_dnd) { diff --git a/xwl/databridge.h b/xwl/databridge.h index ec64d946b9..e3f6b4a106 100644 --- a/xwl/databridge.h +++ b/xwl/databridge.h @@ -12,10 +12,6 @@ #include #include -#include - -struct xcb_xfixes_selection_notify_event_t; - namespace KWayland { namespace Client @@ -75,8 +71,6 @@ public: private: void init(); - bool handleXfixesNotify(xcb_xfixes_selection_notify_event_t *event); - Clipboard *m_clipboard = nullptr; Dnd *m_dnd = nullptr; diff --git a/xwl/selection.cpp b/xwl/selection.cpp index f856d13b46..3c83bb8cdc 100644 --- a/xwl/selection.cpp +++ b/xwl/selection.cpp @@ -12,8 +12,9 @@ #include "transfer.h" #include "atoms.h" -#include "x11client.h" #include "workspace.h" +#include "x11client.h" +#include "xcbutils.h" #include #include @@ -124,6 +125,9 @@ bool Selection::filterEvent(xcb_generic_event_t *event) case XCB_CLIENT_MESSAGE: return handleClientMessage(reinterpret_cast(event)); default: + if (event->response_type == Xcb::Extensions::self()->fixesSelectionNotifyEvent()) { + return handleXfixesNotify(reinterpret_cast(event)); + } return false; } }