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

wayland: Require to reboot computer after changing primary selection option

Not all clients handle well withdrawing the primary selection global at
runtime, so apply the new primary selection option only after a reboot.

(cherry picked from commit eec07c47)
parent 07195af2
Pipeline #287559 passed with stage
in 12 minutes and 15 seconds
......@@ -200,10 +200,6 @@ void ApplicationWayland::refreshSettings(const KConfigGroup &group, const QByteA
if (m_startXWayland && group.name() == "Xwayland" && names.contains("Scale")) {
setXwaylandScale(group.readEntry("Scale", 1.0));
}
if (group.name() == "Wayland" && names.contains("EnablePrimarySelection")) {
waylandServer()->setEnablePrimarySelection(group.readEntry("EnablePrimarySelection", true));
}
}
void ApplicationWayland::startSession()
......
......@@ -301,16 +301,6 @@ void WaylandServer::handleOutputDisabled(Output *output)
}
}
void WaylandServer::setEnablePrimarySelection(bool enable)
{
if (!enable && m_primarySelectionDeviceManager != nullptr) {
delete m_primarySelectionDeviceManager;
m_primarySelectionDeviceManager = nullptr;
} else if (enable && m_primarySelectionDeviceManager == nullptr) {
m_primarySelectionDeviceManager = new PrimarySelectionDeviceManagerV1Interface(m_display, m_display);
}
}
bool WaylandServer::start()
{
return m_display->start();
......@@ -391,7 +381,9 @@ bool WaylandServer::init(InitializationFlags flags)
new DataControlDeviceManagerV1Interface(m_display, m_display);
const auto kwinConfig = kwinApp()->config();
setEnablePrimarySelection(kwinConfig->group("Wayland").readEntry("EnablePrimarySelection", true));
if (kwinConfig->group("Wayland").readEntry("EnablePrimarySelection", true)) {
new PrimarySelectionDeviceManagerV1Interface(m_display, m_display);
}
m_idle = new IdleInterface(m_display, m_display);
auto idleInhibition = new IdleInhibition(m_idle);
......
......@@ -48,7 +48,6 @@ class LinuxDmaBufV1ClientBuffer;
class TabletManagerV2Interface;
class KeyboardShortcutsInhibitManagerV1Interface;
class XdgDecorationManagerV1Interface;
class PrimarySelectionDeviceManagerV1Interface;
}
namespace KWin
......@@ -220,7 +219,6 @@ public:
{
m_linuxDmabufBuffers.remove(buffer);
}
void setEnablePrimarySelection(bool enable);
/**
* Returns the first socket name that can be used to connect to this server.
......@@ -288,7 +286,6 @@ private:
KWaylandServer::XdgForeignV2Interface *m_XdgForeign = nullptr;
KWaylandServer::PrimaryOutputV1Interface *m_primary = nullptr;
XdgActivationV1Integration *m_xdgActivationIntegration = nullptr;
KWaylandServer::PrimarySelectionDeviceManagerV1Interface *m_primarySelectionDeviceManager = nullptr;
QList<Window *> m_windows;
InitializationFlags m_initFlags;
QHash<Output *, WaylandOutput *> m_waylandOutputs;
......
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