Commit c86d3b71 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

xwayland: Call handleXfixesNotify() directly from Selection

parent 17a1640e
......@@ -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) {
......
......@@ -12,10 +12,6 @@
#include <QObject>
#include <QPoint>
#include <xcb/xcb.h>
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;
......
......@@ -12,8 +12,9 @@
#include "transfer.h"
#include "atoms.h"
#include "x11client.h"
#include "workspace.h"
#include "x11client.h"
#include "xcbutils.h"
#include <xcb/xcb_event.h>
#include <xcb/xfixes.h>
......@@ -124,6 +125,9 @@ bool Selection::filterEvent(xcb_generic_event_t *event)
case XCB_CLIENT_MESSAGE:
return handleClientMessage(reinterpret_cast<xcb_client_message_event_t *>(event));
default:
if (event->response_type == Xcb::Extensions::self()->fixesSelectionNotifyEvent()) {
return handleXfixesNotify(reinterpret_cast<xcb_xfixes_selection_notify_event_t *>(event));
}
return false;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment