Commit a9c01acf authored by David Redondo's avatar David Redondo 🏎
Browse files

Take screenshot with currently selected options

If Spectacle is running and the user activates the shortcut to start Spectacle
while he has the option "Take a new Screenshot" selected use the current settings
ad configured in the window and not those of the last taken Screenshot

BUG: 415688
FIXED-IN: 20.04.0

Test Plan: Open Spectacle, press print screen

Reviewers: #spectacle, ngraham

Reviewed By: #spectacle, ngraham

Tags: #spectacle

Differential Revision:
parent c2d30612
......@@ -172,11 +172,9 @@ void SpectacleCore::dbusStartAgent()
using Actions = Settings::EnumPrintKeyActionRunning;
switch (Settings::printKeyActionRunning()) {
case Actions::TakeNewScreenshot: {
auto lShutterMode = mPlatform->supportedShutterModes().testFlag(Platform::ShutterMode::Immediate) ? Platform::ShutterMode::Immediate : Platform::ShutterMode::OnClick;
auto lGrabMode = toPlatformGrabMode(ExportManager::instance()->captureMode());
QTimer::singleShot(KWindowSystem::compositingActive() ? 200 : 50, this, [this, lShutterMode, lGrabMode, lIncludePointer, lIncludeDecorations]() {
mPlatform->doGrab(lShutterMode, lGrabMode, lIncludePointer, lIncludeDecorations);
// 0 means Immediate, -1 onClick
int timeout = mPlatform->supportedShutterModes().testFlag(Platform::ShutterMode::Immediate) ? 0 : -1;
takeNewScreenshot(Settings::captureMode(), timeout, Settings::includePointer(), Settings::includeDecorations());
case Actions::FocusWindow:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment