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()
{
setTerminating();
kwinApp()->platform()->setOutputsEnabled(false);
// 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
if (effects) {

View file

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

View file

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

View file

@ -312,7 +312,6 @@ bool DrmBackend::updateOutputs()
if (oldOutputs != m_outputs) {
readOutputsConfiguration();
}
updateOutputsEnabled();
if (!m_outputs.isEmpty()) {
emit screensQueried();
}
@ -443,7 +442,6 @@ void DrmBackend::enableOutput(DrmOutput *output, bool enable)
emit output->gpu()->outputDisabled(output);
emit outputDisabled(output);
}
updateOutputsEnabled();
checkOutputsAreOn();
emit screensQueried();
}
@ -582,15 +580,6 @@ OpenGLBackend *DrmBackend::createOpenGLBackend()
#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
{
if (selectedCompositor() != NoCompositing) {

View file

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