Commit 8137b8a3 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

xwayland: Fix initialization of WM_S0 selection owner

The selection owner must live as long as the X11 connection is valid;
otherwise Xwayland won't catch the corresponding selection ownership
change event, and the initialization sequence will be incomplete.
parent 3c63750f
......@@ -158,6 +158,7 @@ void Xwayland::stop()
uninstallSocketNotifier();
DataBridge::destroy();
m_selectionOwner.reset();
destroyX11Connection();
......@@ -318,8 +319,8 @@ void Xwayland::handleXwaylandReady()
qputenv("DISPLAY", m_displayName);
// create selection owner for WM_S0 - magic X display number expected by XWayland
KSelectionOwner owner("WM_S0", kwinApp()->x11Connection(), kwinApp()->x11RootWindow());
owner.claim(true);
m_selectionOwner.reset(new KSelectionOwner("WM_S0", kwinApp()->x11Connection(), kwinApp()->x11RootWindow()));
m_selectionOwner->claim(true);
DataBridge::create(this);
......
......@@ -16,6 +16,8 @@
#include <QProcess>
#include <QSocketNotifier>
class KSelectionOwner;
namespace KWin
{
class ApplicationWaylandAbstract;
......@@ -105,6 +107,7 @@ private:
QByteArray m_displayName;
QFutureWatcher<QByteArray> *m_watcher = nullptr;
ApplicationWaylandAbstract *m_app;
QScopedPointer<KSelectionOwner> m_selectionOwner;
int m_crashCount = 0;
Q_DISABLE_COPY(Xwayland)
......
Supports Markdown
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