kwin/src/xwl/databridge.h
David Edmundson 65f168e144 Use a direct connection for X to wayland drags
We already use a direct DataSource object for transfer.

Use of the new public SeatInterface::startDrag allows us to start our drag directly.
2021-09-09 11:13:02 +00:00

72 lines
1.3 KiB
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2018 Roman Gilg <subdiff@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KWIN_XWL_DATABRIDGE
#define KWIN_XWL_DATABRIDGE
#include "kwinglobals.h"
#include <QAbstractNativeEventFilter>
#include <QObject>
#include <QPoint>
namespace KWaylandServer
{
class DataDeviceInterface;
class SurfaceInterface;
}
namespace KWin
{
class Toplevel;
namespace Xwl
{
class Clipboard;
class Dnd;
class Primary;
enum class DragEventReply;
/**
* Interface class for all data sharing in the context of X selections
* and Wayland's internal mechanism.
*
* Exists only once per Xwayland session.
*/
class DataBridge : public QObject, public QAbstractNativeEventFilter
{
Q_OBJECT
public:
static void destroy();
~DataBridge() override;
DragEventReply dragMoveFilter(Toplevel *target, const QPoint &pos);
Dnd *dnd() const
{
return m_dnd;
}
bool nativeEventFilter(const QByteArray &eventType, void *message, long int *result) override;
private:
void init();
Clipboard *m_clipboard = nullptr;
Dnd *m_dnd = nullptr;
Primary *m_primary = nullptr;
KWIN_SINGLETON(DataBridge)
};
} // namespace Xwl
} // namespace KWin
#endif