Skip to content

Commit

Permalink
Screenshot: Ignore delay on Print Screen
Browse files Browse the repository at this point in the history
The delay variable is only considered when you push the
"New screenshot" button as suggested by diver.

Fixes #11447
  • Loading branch information
jscipione committed Mar 31, 2016
1 parent 63fd7a2 commit ea810bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 9 additions & 6 deletions src/apps/screenshot/ScreenshotWindow.cpp
Expand Up @@ -140,7 +140,7 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent,

// Check if fUtility contains valid data
if (fUtility.wholeScreen == NULL) {
_NewScreenshot(silent, clipboard);
_NewScreenshot(silent, clipboard, true);
return;
}

Expand Down Expand Up @@ -391,15 +391,18 @@ ScreenshotWindow::Quit()


void
ScreenshotWindow::_NewScreenshot(bool silent, bool clipboard)
ScreenshotWindow::_NewScreenshot(bool silent, bool clipboard, bool ignoreDelay)
{
BMessage message(B_ARGV_RECEIVED);
int32 argc = 3;
BString delay;
delay << fDelay / 1000000;
message.AddString("argv", "screenshot");
message.AddString("argv", "--delay");
message.AddString("argv", delay);

if (!ignoreDelay) {
BString delay;
delay << fDelay / 1000000;
message.AddString("argv", "--delay");
message.AddString("argv", delay);
}

if (silent || clipboard) {
if (silent) {
Expand Down
3 changes: 2 additions & 1 deletion src/apps/screenshot/ScreenshotWindow.h
Expand Up @@ -40,7 +40,8 @@ class ScreenshotWindow : public BWindow {

private:
void _NewScreenshot(bool silent = false,
bool clipboard = false);
bool clipboard = false,
bool ignoreDelay = false);
void _UpdatePreviewPanel();
void _DisallowChar(BTextView* textView);
void _SetupOutputPathMenu(const BMessage& settings);
Expand Down

0 comments on commit ea810bf

Please sign in to comment.