disable-screenshot-notification.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --- a/js/ui/screenshot.js
  2. +++ b/js/ui/screenshot.js
  3. @@ -2195,48 +2195,7 @@ function _storeScreenshot(bytes, pixbuf) {
  4. pixbuf.rowstride
  5. );
  6. - // Show a notification.
  7. - const source = new MessageTray.Source(
  8. - // Translators: notification source name.
  9. - _('Screenshot'),
  10. - 'screenshot-recorded-symbolic'
  11. - );
  12. - const notification = new MessageTray.Notification(
  13. - source,
  14. - // Translators: notification title.
  15. - _('Screenshot captured'),
  16. - // Translators: notification body when a screenshot was captured.
  17. - _('You can paste the image from the clipboard.'),
  18. - {datetime: time, gicon: content}
  19. - );
  20. -
  21. - if (!disableSaveToDisk) {
  22. - // Translators: button on the screenshot notification.
  23. - notification.addAction(_('Show in Files'), () => {
  24. - const app =
  25. - Gio.app_info_get_default_for_type('inode/directory', false);
  26. -
  27. - if (app === null) {
  28. - // It may be null e.g. in a toolbox without nautilus.
  29. - log('Error showing in files: no default app set for inode/directory');
  30. - return;
  31. - }
  32. -
  33. - app.launch([file], global.create_app_launch_context(0, -1));
  34. - });
  35. - notification.connect('activated', () => {
  36. - try {
  37. - Gio.app_info_launch_default_for_uri(
  38. - file.get_uri(), global.create_app_launch_context(0, -1));
  39. - } catch (err) {
  40. - logError(err, 'Error opening screenshot');
  41. - }
  42. - });
  43. - }
  44. -
  45. - notification.setTransient(true);
  46. - Main.messageTray.add(source);
  47. - source.showNotification(notification);
  48. + // patched: do not show a notification after taking a screenshot
  49. }
  50. /**