08_fix-beeping.patch 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. Description: Fix missing option for beep prevention.
  2. Author: Ibragimov Rinat <ibragimovrinat@mail.ru>
  3. Last-Update: 2010-06-30
  4. Index: scrot-0.8/scrot.1
  5. ===================================================================
  6. --- scrot-0.8.orig/scrot.1
  7. +++ scrot-0.8/scrot.1
  8. @@ -49,6 +49,9 @@ Use the currently focused window.
  9. .B -t, --thumb NUM
  10. generate thumbnail too. NUM is the percentage of the original size for the
  11. thumbnail to be.
  12. +.TP 5
  13. +.B -z, --silent
  14. +prevent beeping.
  15. .SH SPECIAL STRINGS
  16. Both the
  17. .B --exec
  18. Index: scrot-0.8/src/main.c
  19. ===================================================================
  20. --- scrot-0.8.orig/src/main.c
  21. +++ scrot-0.8/src/main.c
  22. @@ -154,7 +154,7 @@ scrot_grab_shot(void)
  23. {
  24. Imlib_Image im;
  25. - XBell(disp, 0);
  26. + if (! opt.silent) XBell(disp, 0);
  27. im =
  28. gib_imlib_create_image_from_drawable(root, 0, 0, 0, scr->width,
  29. scr->height, 1);
  30. @@ -336,7 +336,7 @@ scrot_sel_and_grab_image(void)
  31. }
  32. scrot_nice_clip(&rx, &ry, &rw, &rh);
  33. - XBell(disp, 0);
  34. + if (! opt.silent) XBell(disp, 0);
  35. im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1);
  36. }
  37. return im;
  38. Index: scrot-0.8/src/options.c
  39. ===================================================================
  40. --- scrot-0.8.orig/src/options.c
  41. +++ scrot-0.8/src/options.c
  42. @@ -44,7 +44,7 @@ init_parse_options(int argc, char **argv
  43. static void
  44. scrot_parse_option_array(int argc, char **argv)
  45. {
  46. - static char stropts[] = "bcd:e:hmq:st:uv+:";
  47. + static char stropts[] = "bcd:e:hmq:st:uv+:z";
  48. static struct option lopts[] = {
  49. /* actions */
  50. {"help", 0, 0, 'h'}, /* okay */
  51. @@ -55,6 +55,7 @@ scrot_parse_option_array(int argc, char
  52. {"focussed", 0, 0, 'u'}, /* macquarie dictionary has both spellings */
  53. {"border", 0, 0, 'b'},
  54. {"multidisp", 0, 0, 'm'},
  55. + {"silent", 0, 0, 'z'},
  56. /* toggles */
  57. {"thumb", 1, 0, 't'},
  58. {"delay", 1, 0, 'd'},
  59. @@ -109,6 +110,9 @@ scrot_parse_option_array(int argc, char
  60. case 't':
  61. options_parse_thumbnail(optarg);
  62. break;
  63. + case 'z':
  64. + opt.silent = 1;
  65. + break;
  66. default:
  67. break;
  68. }
  69. @@ -246,6 +250,7 @@ show_usage(void)
  70. " -t, --thumb NUM generate thumbnail too. NUM is the percentage\n"
  71. " of the original size for the thumbnail to be,\n"
  72. " or the geometry in percent, e.g. 50x60 or 80x20.\n"
  73. + " -z, --silent Prevent beeping\n"
  74. "\n" " SPECIAL STRINGS\n"
  75. " Both the --exec and filename parameters can take format specifiers\n"
  76. " that are expanded by " PACKAGE " when encountered.\n"
  77. Index: scrot-0.8/src/options.h
  78. ===================================================================
  79. --- scrot-0.8.orig/src/options.h
  80. +++ scrot-0.8/src/options.h
  81. @@ -35,6 +35,7 @@ struct __scrotoptions
  82. int focused;
  83. int quality;
  84. int border;
  85. + int silent;
  86. int multidisp;
  87. int thumb;
  88. int thumb_width;