Changeset View
Changeset View
Standalone View
Standalone View
src/Gui/KSMainWindow.cpp
Show First 20 Lines • Show All 268 Lines • ▼ Show 20 Line(s) | 264 | { | |||
---|---|---|---|---|---|
269 | 269 | | |||
270 | guiConfig.writeEntry("window-position", pos()); | 270 | guiConfig.writeEntry("window-position", pos()); | ||
271 | guiConfig.sync(); | 271 | guiConfig.sync(); | ||
272 | } | 272 | } | ||
273 | 273 | | |||
274 | // slots | 274 | // slots | ||
275 | void KSMainWindow::captureScreenshot(Spectacle::CaptureMode theCaptureMode, int theTimeout, bool theIncludePointer, bool theIncludeDecorations) | 275 | void KSMainWindow::captureScreenshot(Spectacle::CaptureMode theCaptureMode, int theTimeout, bool theIncludePointer, bool theIncludeDecorations) | ||
276 | { | 276 | { | ||
277 | if (theTimeout < 0) { // OnClick is checked (always the case on Wayland) | ||||
278 | emit newScreenshotRequest(theCaptureMode, theTimeout, theIncludePointer, theIncludeDecorations); | ||||
279 | return; | ||||
280 | } | ||||
anthonyfieroni: Just make it 0
```
if (theTimeout < 0) {
theTimeout = 0;
}
``` | |||||
I had the same idea but that unfortunately doesn't work because the timeout is used inside spectacle core to figure out if the screenshot should happen after a time or on click. If it isn't onclick platformkwinwayland will just return and do nothing davidre: I had the same idea but that unfortunately doesn't work because the timeout is used inside… | |||||
To me, it still better to be there, you can discard time in platformwayland and just do it. You can wait for other opinions as well. anthonyfieroni: To me, it still better to be there, you can discard time in platformwayland and just do it. You… | |||||
After thinking about it that wouldn't work because then we couldn't differentiate on X anymore, too. davidre: After thinking about it that wouldn't work because then we couldn't differentiate on X anymore… | |||||
277 | showMinimized(); | 281 | showMinimized(); | ||
278 | mMessageWidget->hide(); | 282 | mMessageWidget->hide(); | ||
279 | QTimer* timer = new QTimer; | 283 | QTimer* timer = new QTimer; | ||
280 | timer->setSingleShot(true); | 284 | timer->setSingleShot(true); | ||
281 | timer->setInterval(theTimeout); | 285 | timer->setInterval(theTimeout); | ||
282 | auto unityUpdate = [](const QVariantMap &properties) { | 286 | auto unityUpdate = [](const QVariantMap &properties) { | ||
283 | QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/org/kde/Spectacle"), | 287 | QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/org/kde/Spectacle"), | ||
284 | QStringLiteral("com.canonical.Unity.LauncherEntry"), QStringLiteral("Update")); | 288 | QStringLiteral("com.canonical.Unity.LauncherEntry"), QStringLiteral("Update")); | ||
▲ Show 20 Lines • Show All 199 Lines • Show Last 20 Lines |
Just make it 0