Skip to content

Commit 8acd7a2

Browse files
committed
always ring the bell after taking the shot
currently it only rings it after certain cases but not all. move the bell ringing outside of grab mode specific code and into main() where it will be consistently rang in case of a successful capture regardless of grab mode. Fixes: #412
1 parent 7a169bc commit 8acd7a2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/scrot.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ int main(int argc, char *argv[])
151151
}
152152
tm = localtime(&timeStamp.tv_sec);
153153

154+
if (!opt.silent) {
155+
XBell(disp, 0);
156+
XFlush(disp);
157+
}
158+
154159
if (opt.note)
155160
scrotNoteDraw(image);
156161

@@ -624,8 +629,6 @@ static int scrotMatchWindowClassName(Window target)
624629

625630
static Imlib_Image scrotGrabShot(void)
626631
{
627-
if (!opt.silent)
628-
XBell(disp, 0);
629632
return scrotGrabRectAndPointer(0, 0, scr->width, scr->height, false);
630633
}
631634

src/scrot_selection.c

-3
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,6 @@ static bool scrotSelectionGetUserSel(struct SelectionRect *selectionRect)
345345
}
346346
scrotNiceClip(&rx, &ry, &rw, &rh);
347347

348-
if (!opt.silent)
349-
XBell(disp, 0);
350-
351348
selectionRect->x = rx;
352349
selectionRect->y = ry;
353350
selectionRect->w = rw;

0 commit comments

Comments
 (0)