Remove Platform::areOutputsEnabled()

This flag is redundant. If an output is disabled, the compositor won't
attempt to perform compositing on it.
This commit is contained in:
Vlad Zahorodnii 2021-04-29 09:07:45 +03:00
parent f8c00a530f
commit ac3c09ba75
5 changed files with 1 additions and 25 deletions

View file

@ -74,7 +74,6 @@ WaylandTestApplication::WaylandTestApplication(OperationMode mode, int &argc, ch
WaylandTestApplication::~WaylandTestApplication() WaylandTestApplication::~WaylandTestApplication()
{ {
setTerminating(); setTerminating();
kwinApp()->platform()->setOutputsEnabled(false);
// need to unload all effects prior to destroying X connection as they might do X calls // need to unload all effects prior to destroying X connection as they might do X calls
// also before destroy Workspace, as effects might call into Workspace // also before destroy Workspace, as effects might call into Workspace
if (effects) { if (effects) {

View file

@ -586,11 +586,7 @@ void Compositor::addRepaintFull()
void Compositor::handleFrameRequested(RenderLoop *renderLoop) void Compositor::handleFrameRequested(RenderLoop *renderLoop)
{ {
// If outputs are disabled, we return to the event loop and composite(renderLoop);
// continue processing events until the outputs are enabled again
if (kwinApp()->platform()->areOutputsEnabled()) {
composite(renderLoop);
}
} }
void Compositor::composite(RenderLoop *renderLoop) void Compositor::composite(RenderLoop *renderLoop)

View file

@ -344,12 +344,6 @@ public:
bool supportsPointerWarping() const { bool supportsPointerWarping() const {
return m_pointerWarping; return m_pointerWarping;
} }
bool areOutputsEnabled() const {
return m_outputsEnabled;
}
void setOutputsEnabled(bool enabled) {
m_outputsEnabled = enabled;
}
int initialOutputCount() const { int initialOutputCount() const {
return m_initialOutputCount; return m_initialOutputCount;
} }
@ -583,7 +577,6 @@ private:
QSize m_initialWindowSize; QSize m_initialWindowSize;
QByteArray m_deviceIdentifier; QByteArray m_deviceIdentifier;
bool m_pointerWarping = false; bool m_pointerWarping = false;
bool m_outputsEnabled = true;
int m_initialOutputCount = 1; int m_initialOutputCount = 1;
qreal m_initialOutputScale = 1; qreal m_initialOutputScale = 1;
EGLDisplay m_eglDisplay; EGLDisplay m_eglDisplay;

View file

@ -312,7 +312,6 @@ bool DrmBackend::updateOutputs()
if (oldOutputs != m_outputs) { if (oldOutputs != m_outputs) {
readOutputsConfiguration(); readOutputsConfiguration();
} }
updateOutputsEnabled();
if (!m_outputs.isEmpty()) { if (!m_outputs.isEmpty()) {
emit screensQueried(); emit screensQueried();
} }
@ -443,7 +442,6 @@ void DrmBackend::enableOutput(DrmOutput *output, bool enable)
emit output->gpu()->outputDisabled(output); emit output->gpu()->outputDisabled(output);
emit outputDisabled(output); emit outputDisabled(output);
} }
updateOutputsEnabled();
checkOutputsAreOn(); checkOutputsAreOn();
emit screensQueried(); emit screensQueried();
} }
@ -582,15 +580,6 @@ OpenGLBackend *DrmBackend::createOpenGLBackend()
#endif #endif
} }
void DrmBackend::updateOutputsEnabled()
{
bool enabled = false;
for (auto it = m_enabledOutputs.constBegin(); it != m_enabledOutputs.constEnd(); ++it) {
enabled = enabled || (*it)->isDpmsEnabled();
}
setOutputsEnabled(enabled);
}
QVector<CompositingType> DrmBackend::supportedCompositors() const QVector<CompositingType> DrmBackend::supportedCompositors() const
{ {
if (selectedCompositor() != NoCompositing) { if (selectedCompositor() != NoCompositing) {

View file

@ -91,7 +91,6 @@ private:
void readOutputsConfiguration(); void readOutputsConfiguration();
void writeOutputsConfiguration(); void writeOutputsConfiguration();
QString generateOutputConfigurationUuid() const; QString generateOutputConfigurationUuid() const;
void updateOutputsEnabled();
void handleUdevEvent(); void handleUdevEvent();
DrmGpu *addGpu(std::unique_ptr<UdevDevice> device); DrmGpu *addGpu(std::unique_ptr<UdevDevice> device);