From 329c5de451c6c3c7090e5ebda340ccbb8d2117de Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 26 Feb 2024 15:53:19 +0200 Subject: [PATCH] xwayland: Ignore somebody else claiming WM_S0 selection If somebody else claims the selection, it's unclear what we should do. kwin can't give up its selection as it's the one who is responsible for window management and compositing. If anything, Xwayland should ensure that no client can claim WM_S0. --- src/xwayland/xwayland.cpp | 27 ++------------------------- src/xwayland/xwayland.h | 4 ---- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/src/xwayland/xwayland.cpp b/src/xwayland/xwayland.cpp index e90bae34e6..10bf086d8a 100644 --- a/src/xwayland/xwayland.cpp +++ b/src/xwayland/xwayland.cpp @@ -535,12 +535,6 @@ void Xwayland::handleXwaylandReady() // create selection owner for WM_S0 - magic X display number expected by XWayland m_windowManagerSelectionOwner = std::make_unique("WM_S0", kwinApp()->x11Connection(), kwinApp()->x11RootWindow()); - connect(m_windowManagerSelectionOwner.get(), &KSelectionOwner::lostOwnership, - this, &Xwayland::handleSelectionLostOwnership); - connect(m_windowManagerSelectionOwner.get(), &KSelectionOwner::claimedOwnership, - this, &Xwayland::handleSelectionClaimedOwnership); - connect(m_windowManagerSelectionOwner.get(), &KSelectionOwner::failedToClaimOwnership, - this, &Xwayland::handleSelectionFailedToClaimOwnership); m_windowManagerSelectionOwner->claim(true); m_dataBridge = std::make_unique(); @@ -548,13 +542,13 @@ void Xwayland::handleXwaylandReady() connect(workspace(), &Workspace::outputOrderChanged, this, &Xwayland::updatePrimary); updatePrimary(); - Xcb::sync(); // Trigger possible errors, there's still a chance to abort - delete m_xrandrEventsFilter; m_xrandrEventsFilter = new XrandrEventFilter(this); refreshEavesdropping(); connect(options, &Options::xwaylandEavesdropsChanged, this, &Xwayland::refreshEavesdropping); + + Q_EMIT started(); } void Xwayland::refreshEavesdropping() @@ -608,23 +602,6 @@ void Xwayland::updatePrimary() } } -void Xwayland::handleSelectionLostOwnership() -{ - qCWarning(KWIN_XWL) << "Somebody else claimed ownership of WM_S0. This should never happen!"; - m_launcher->stop(); -} - -void Xwayland::handleSelectionFailedToClaimOwnership() -{ - qCWarning(KWIN_XWL) << "Failed to claim ownership of WM_S0. This should never happen!"; - m_launcher->stop(); -} - -void Xwayland::handleSelectionClaimedOwnership() -{ - Q_EMIT started(); -} - bool Xwayland::createX11Connection() { xcb_connection_t *connection = xcb_connect_to_fd(m_launcher->xcbConnectionFd(), nullptr); diff --git a/src/xwayland/xwayland.h b/src/xwayland/xwayland.h index b3b853c356..73ceeff163 100644 --- a/src/xwayland/xwayland.h +++ b/src/xwayland/xwayland.h @@ -58,10 +58,6 @@ private Q_SLOTS: void handleXwaylandFinished(); void handleXwaylandReady(); - void handleSelectionLostOwnership(); - void handleSelectionFailedToClaimOwnership(); - void handleSelectionClaimedOwnership(); - private: friend class XrandrEventFilter;