|
|
@ -18,22 +18,22 @@ CCBUG: 412350
|
|
|
|
2 files changed, 11 insertions(+)
|
|
|
|
2 files changed, 11 insertions(+)
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/xwl/clipboard.cpp b/xwl/clipboard.cpp
|
|
|
|
diff --git a/xwl/clipboard.cpp b/xwl/clipboard.cpp
|
|
|
|
index b2f3435a5..a64fda0ae 100644
|
|
|
|
index 37a5c3b..87ee5cd 100644
|
|
|
|
--- a/xwl/clipboard.cpp
|
|
|
|
--- a/xwl/clipboard.cpp
|
|
|
|
+++ b/xwl/clipboard.cpp
|
|
|
|
+++ b/xwl/clipboard.cpp
|
|
|
|
@@ -66,6 +66,10 @@ Clipboard::Clipboard(xcb_atom_t atom, QObject *parent)
|
|
|
|
@@ -66,6 +66,10 @@ Clipboard::Clipboard(xcb_atom_t atom, QObject *parent)
|
|
|
|
|
|
|
|
|
|
|
|
void Clipboard::wlSelectionChanged(KWaylandServer::AbstractDataSource *dsi)
|
|
|
|
void Clipboard::wlSelectionChanged(KWaylandServer::AbstractDataSource *dsi)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
+ if (m_waitingForTargets) {
|
|
|
|
+ if (m_waitingForTargets) {
|
|
|
|
+ return;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
if (!ownsSelection(dsi)) {
|
|
|
|
if (dsi && !ownsSelection(dsi)) {
|
|
|
|
// Wayland native client provides new selection
|
|
|
|
// Wayland native client provides new selection
|
|
|
|
if (!m_checkConnection) {
|
|
|
|
if (!m_checkConnection) {
|
|
|
|
@@ -85,6 +89,10 @@ bool Clipboard::ownsSelection(KWaylandServer::AbstractDataSource *dsi) const
|
|
|
|
@@ -88,6 +92,10 @@ bool Clipboard::ownsSelection(KWaylandServer::AbstractDataSource *dsi) const
|
|
|
|
|
|
|
|
|
|
|
|
void Clipboard::checkWlSource()
|
|
|
|
void Clipboard::checkWlSource()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
+ if (m_waitingForTargets) {
|
|
|
|
+ if (m_waitingForTargets) {
|
|
|
@ -43,33 +43,32 @@ index b2f3435a5..a64fda0ae 100644
|
|
|
|
auto dsi = waylandServer()->seat()->selection();
|
|
|
|
auto dsi = waylandServer()->seat()->selection();
|
|
|
|
auto removeSource = [this] {
|
|
|
|
auto removeSource = [this] {
|
|
|
|
if (wlSource()) {
|
|
|
|
if (wlSource()) {
|
|
|
|
@@ -142,6 +150,7 @@ void Clipboard::doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event)
|
|
|
|
@@ -145,11 +153,13 @@ void Clipboard::doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event)
|
|
|
|
|
|
|
|
|
|
|
|
if (X11Source *source = x11Source()) {
|
|
|
|
if (X11Source *source = x11Source()) {
|
|
|
|
source->getTargets();
|
|
|
|
source->getTargets();
|
|
|
|
+ m_waitingForTargets = true;
|
|
|
|
+ m_waitingForTargets = true;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
qCWarning(KWIN_XWL) << "Could not create a source from" << event << Qt::hex << (event ? event->owner : -1);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -149,6 +158,7 @@ void Clipboard::doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Clipboard::x11OffersChanged(const QStringList &added, const QStringList &removed)
|
|
|
|
void Clipboard::x11OffersChanged(const QStringList &added, const QStringList &removed)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
+ m_waitingForTargets = false;
|
|
|
|
+ m_waitingForTargets = false;
|
|
|
|
X11Source *source = x11Source();
|
|
|
|
X11Source *source = x11Source();
|
|
|
|
if (!source) {
|
|
|
|
if (!source) {
|
|
|
|
qCWarning(KWIN_XWL) << "offers changed when not having an X11Source!?";
|
|
|
|
return;
|
|
|
|
diff --git a/xwl/clipboard.h b/xwl/clipboard.h
|
|
|
|
diff --git a/xwl/clipboard.h b/xwl/clipboard.h
|
|
|
|
index c2296845a..f534d1f3e 100644
|
|
|
|
index c229684..f534d1f 100644
|
|
|
|
--- a/xwl/clipboard.h
|
|
|
|
--- a/xwl/clipboard.h
|
|
|
|
+++ b/xwl/clipboard.h
|
|
|
|
+++ b/xwl/clipboard.h
|
|
|
|
@@ -53,6 +53,7 @@ private:
|
|
|
|
@@ -53,6 +53,7 @@ private:
|
|
|
|
QMetaObject::Connection m_checkConnection;
|
|
|
|
QMetaObject::Connection m_checkConnection;
|
|
|
|
|
|
|
|
|
|
|
|
Q_DISABLE_COPY(Clipboard)
|
|
|
|
Q_DISABLE_COPY(Clipboard)
|
|
|
|
+ bool m_waitingForTargets = false;
|
|
|
|
+ bool m_waitingForTargets = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace Xwl
|
|
|
|
} // namespace Xwl
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
--
|
|
|
|
GitLab
|
|
|
|
GitLab
|
|
|
|