Changeset View
Changeset View
Standalone View
Standalone View
src/SpectacleCore.cpp
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Line(s) | 160 | { | |||
---|---|---|---|---|---|
167 | 167 | | |||
168 | if (!(mStartMode == StartMode::Gui)) { | 168 | if (!(mStartMode == StartMode::Gui)) { | ||
169 | mStartMode = StartMode::Gui; | 169 | mStartMode = StartMode::Gui; | ||
170 | initGui(lIncludePointer, lIncludeDecorations); | 170 | initGui(lIncludePointer, lIncludeDecorations); | ||
171 | } else { | 171 | } else { | ||
172 | using Actions = Settings::EnumPrintKeyActionRunning; | 172 | using Actions = Settings::EnumPrintKeyActionRunning; | ||
173 | switch (Settings::printKeyActionRunning()) { | 173 | switch (Settings::printKeyActionRunning()) { | ||
174 | case Actions::TakeNewScreenshot: { | 174 | case Actions::TakeNewScreenshot: { | ||
175 | auto lShutterMode = mPlatform->supportedShutterModes().testFlag(Platform::ShutterMode::Immediate) ? Platform::ShutterMode::Immediate : Platform::ShutterMode::OnClick; | 175 | // 0 means Immediate, -1 onClick | ||
176 | auto lGrabMode = toPlatformGrabMode(ExportManager::instance()->captureMode()); | 176 | int timeout = mPlatform->supportedShutterModes().testFlag(Platform::ShutterMode::Immediate) ? 0 : -1; | ||
177 | QTimer::singleShot(KWindowSystem::compositingActive() ? 200 : 50, this, [this, lShutterMode, lGrabMode, lIncludePointer, lIncludeDecorations]() { | 177 | takeNewScreenshot(Settings::captureMode(), timeout, Settings::includePointer(), Settings::includeDecorations()); | ||
178 | mPlatform->doGrab(lShutterMode, lGrabMode, lIncludePointer, lIncludeDecorations); | | |||
179 | }); | | |||
180 | break; | 178 | break; | ||
181 | } | 179 | } | ||
182 | case Actions::FocusWindow: | 180 | case Actions::FocusWindow: | ||
183 | if (mMainWindow->isMinimized()) { | 181 | if (mMainWindow->isMinimized()) { | ||
184 | mMainWindow->setWindowState(mMainWindow->windowState() & ~Qt::WindowMinimized); | 182 | mMainWindow->setWindowState(mMainWindow->windowState() & ~Qt::WindowMinimized); | ||
185 | } | 183 | } | ||
186 | mMainWindow->activateWindow(); | 184 | mMainWindow->activateWindow(); | ||
187 | break; | 185 | break; | ||
▲ Show 20 Lines • Show All 254 Lines • Show Last 20 Lines |