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

Rework how wl_output and kde-output-device are created

Create wl_outputs only for outputs in Workspace.
parent c7293d95
Pipeline #216769 failed with stage
in 14 minutes and 13 seconds
......@@ -133,7 +133,6 @@ void WaylandTestApplication::performStartup()
if (!platform()->initialize()) {
std::exit(1);
}
waylandServer()->initPlatform();
// try creating the Wayland Backend
createInput();
......
......@@ -147,8 +147,6 @@ void ApplicationWayland::performStartup()
std::exit(1);
}
waylandServer()->initPlatform();
createInput();
createInputMethod();
createTabletModeManager();
......
......@@ -272,30 +272,6 @@ void WaylandServer::registerXdgGenericWindow(Window *window)
qCDebug(KWIN_CORE) << "Received invalid xdg shell window:" << window->surface();
}
void WaylandServer::initPlatform()
{
connect(kwinApp()->platform(), &Platform::outputAdded, this, &WaylandServer::handleOutputAdded);
connect(kwinApp()->platform(), &Platform::outputRemoved, this, &WaylandServer::handleOutputRemoved);
connect(kwinApp()->platform(), &Platform::outputEnabled, this, &WaylandServer::handleOutputEnabled);
connect(kwinApp()->platform(), &Platform::outputDisabled, this, &WaylandServer::handleOutputDisabled);
connect(kwinApp()->platform(), &Platform::primaryOutputChanged, this, [this](Output *primaryOutput) {
m_primary->setPrimaryOutput(primaryOutput ? primaryOutput->name() : QString());
});
if (auto primaryOutput = kwinApp()->platform()->primaryOutput()) {
m_primary->setPrimaryOutput(primaryOutput->name());
}
const QVector<Output *> outputs = kwinApp()->platform()->outputs();
for (Output *output : outputs) {
handleOutputAdded(output);
if (output->isEnabled()) {
handleOutputEnabled(output);
}
}
}
void WaylandServer::handleOutputAdded(Output *output)
{
if (!output->isPlaceholder() && !output->isNonDesktop()) {
......@@ -561,6 +537,27 @@ void WaylandServer::initWorkspace()
});
}
connect(kwinApp()->platform(), &Platform::primaryOutputChanged, this, [this](Output *primaryOutput) {
m_primary->setPrimaryOutput(primaryOutput ? primaryOutput->name() : QString());
});
if (auto primaryOutput = kwinApp()->platform()->primaryOutput()) {
m_primary->setPrimaryOutput(primaryOutput->name());
}
const auto availableOutputs = kwinApp()->platform()->outputs();
for (Output *output : availableOutputs) {
handleOutputAdded(output);
}
connect(kwinApp()->platform(), &Platform::outputAdded, this, &WaylandServer::handleOutputAdded);
connect(kwinApp()->platform(), &Platform::outputRemoved, this, &WaylandServer::handleOutputRemoved);
const auto outputs = workspace()->outputs();
for (Output *output : outputs) {
handleOutputEnabled(output);
}
connect(workspace(), &Workspace::outputAdded, this, &WaylandServer::handleOutputEnabled);
connect(workspace(), &Workspace::outputRemoved, this, &WaylandServer::handleOutputDisabled);
if (hasScreenLockerIntegration()) {
initScreenLocker();
}
......
......@@ -179,7 +179,6 @@ public:
*/
bool hasGlobalShortcutSupport() const;
void initPlatform();
void initWorkspace();
KWaylandServer::ClientConnection *xWaylandConnection() const;
......
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