Changeset View
Changeset View
Standalone View
Standalone View
platform.cpp
Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Line(s) | 142 | for (auto it = changes.begin(); it != changes.end(); it++) { | |||
---|---|---|---|---|---|
146 | if (!output) { | 146 | if (!output) { | ||
147 | qCWarning(KWIN_CORE) << "Could NOT find output matching " << it.key()->uuid(); | 147 | qCWarning(KWIN_CORE) << "Could NOT find output matching " << it.key()->uuid(); | ||
148 | continue; | 148 | continue; | ||
149 | } | 149 | } | ||
150 | 150 | | |||
151 | if (changeset->enabledChanged() && | 151 | if (changeset->enabledChanged() && | ||
152 | changeset->enabled() == Enablement::Enabled) { | 152 | changeset->enabled() == Enablement::Enabled) { | ||
153 | output->setEnabled(true); | 153 | output->setEnabled(true); | ||
154 | enableOutput(output, true); | | |||
155 | countChanged = true; | 154 | countChanged = true; | ||
156 | } | 155 | } | ||
157 | output->applyChanges(changeset); | 156 | output->applyChanges(changeset); | ||
158 | } | 157 | } | ||
159 | 158 | | |||
160 | //process any disable requests | 159 | //process any disable requests | ||
161 | for (auto it = changes.begin(); it != changes.end(); it++) { | 160 | for (auto it = changes.begin(); it != changes.end(); it++) { | ||
162 | const KWayland::Server::OutputChangeSet *changeset = it.value(); | 161 | const KWayland::Server::OutputChangeSet *changeset = it.value(); | ||
163 | 162 | | |||
164 | if (changeset->enabledChanged() && | 163 | if (changeset->enabledChanged() && | ||
165 | changeset->enabled() == Enablement::Disabled) { | 164 | changeset->enabled() == Enablement::Disabled) { | ||
166 | if (enabledOutputs().count() == 1) { | 165 | if (enabledOutputs().count() == 1) { | ||
167 | // TODO: check beforehand this condition and set failed otherwise | 166 | // TODO: check beforehand this condition and set failed otherwise | ||
168 | // TODO: instead create a dummy output? | 167 | // TODO: instead create a dummy output? | ||
169 | qCWarning(KWIN_CORE) << "Not disabling final screen" << it.key()->uuid(); | 168 | qCWarning(KWIN_CORE) << "Not disabling final screen" << it.key()->uuid(); | ||
170 | continue; | 169 | continue; | ||
171 | } | 170 | } | ||
172 | auto output = findOutput(it.key()->uuid()); | 171 | auto output = findOutput(it.key()->uuid()); | ||
173 | if (!output) { | 172 | if (!output) { | ||
174 | qCWarning(KWIN_CORE) << "Could NOT find output matching " << it.key()->uuid(); | 173 | qCWarning(KWIN_CORE) << "Could NOT find output matching " << it.key()->uuid(); | ||
175 | continue; | 174 | continue; | ||
176 | } | 175 | } | ||
177 | output->setEnabled(false); | 176 | output->setEnabled(false); | ||
178 | enableOutput(output, false); | | |||
179 | countChanged = true; | 177 | countChanged = true; | ||
180 | } | 178 | } | ||
181 | } | 179 | } | ||
182 | | ||||
183 | if (countChanged) { | | |||
184 | emit screensQueried(); | | |||
185 | } else { | | |||
186 | emit screens()->changed(); | 180 | emit screens()->changed(); | ||
187 | } | | |||
188 | config->setApplied(); | 181 | config->setApplied(); | ||
189 | } | 182 | } | ||
190 | 183 | | |||
191 | AbstractOutput *Platform::findOutput(const QByteArray &uuid) | 184 | AbstractOutput *Platform::findOutput(const QByteArray &uuid) | ||
192 | { | 185 | { | ||
193 | const auto outs = outputs(); | 186 | const auto outs = outputs(); | ||
194 | auto it = std::find_if(outs.constBegin(), outs.constEnd(), | 187 | auto it = std::find_if(outs.constBegin(), outs.constEnd(), | ||
195 | [uuid](AbstractOutput *output) { | 188 | [uuid](AbstractOutput *output) { | ||
196 | return output->uuid() == uuid; } | 189 | return output->uuid() == uuid; } | ||
197 | ); | 190 | ); | ||
198 | if (it != outs.constEnd()) { | 191 | if (it != outs.constEnd()) { | ||
199 | return *it; | 192 | return *it; | ||
200 | } | 193 | } | ||
201 | return nullptr; | 194 | return nullptr; | ||
202 | } | 195 | } | ||
203 | 196 | | |||
204 | void Platform::enableOutput(AbstractOutput *output, bool enable) | | |||
205 | { | | |||
206 | Q_UNUSED(output) | | |||
207 | Q_UNUSED(enable) | | |||
208 | } | | |||
209 | | ||||
210 | void Platform::setSoftWareCursor(bool set) | 197 | void Platform::setSoftWareCursor(bool set) | ||
211 | { | 198 | { | ||
212 | if (qEnvironmentVariableIsSet("KWIN_FORCE_SW_CURSOR")) { | 199 | if (qEnvironmentVariableIsSet("KWIN_FORCE_SW_CURSOR")) { | ||
213 | set = true; | 200 | set = true; | ||
214 | } | 201 | } | ||
215 | if (m_softWareCursor == set) { | 202 | if (m_softWareCursor == set) { | ||
216 | return; | 203 | return; | ||
217 | } | 204 | } | ||
▲ Show 20 Lines • Show All 354 Lines • Show Last 20 Lines |