123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- --- a/js/ui/screenshot.js
- +++ b/js/ui/screenshot.js
- @@ -2308,68 +2308,7 @@ function _storeScreenshot(bytes, pixbuf) {
- saveRecentFile(file);
- }
- - // Create a St.ImageContent icon for the notification. We want
- - // St.ImageContent specifically because it preserves the aspect ratio when
- - // shown in a notification.
- - const coglContext = global.stage.context.get_backend().get_cogl_context();
- - const pixels = pixbuf.read_pixel_bytes();
- - const content =
- - St.ImageContent.new_with_preferred_size(pixbuf.width, pixbuf.height);
- - content.set_bytes(
- - coglContext,
- - pixels,
- - Cogl.PixelFormat.RGBA_8888,
- - pixbuf.width,
- - pixbuf.height,
- - pixbuf.rowstride
- - );
- -
- - // Show a notification.
- - const source = new MessageTray.Source({
- - // Translators: notification source name.
- - title: _('Screenshot'),
- - iconName: 'screenshot-recorded-symbolic',
- - });
- - const notification = new MessageTray.Notification({
- - source,
- - // Translators: notification title.
- - title: _('Screenshot captured'),
- - // Translators: notification body when a screenshot was captured.
- - body: _('You can paste the image from the clipboard.'),
- - datetime: time,
- - gicon: content,
- - isTransient: true,
- - });
- -
- - if (!disableSaveToDisk) {
- - // Translators: button on the screenshot notification.
- - notification.addAction(_('Show in Files'), () => {
- - const app =
- - Gio.app_info_get_default_for_type('inode/directory', false);
- -
- - if (app === null) {
- - // It may be null e.g. in a toolbox without nautilus.
- - log('Error showing in files: no default app set for inode/directory');
- - return;
- - }
- -
- - app.launch([file], global.create_app_launch_context(0, -1));
- - });
- - notification.connect('activated', () => {
- - try {
- - Gio.app_info_launch_default_for_uri(
- - file.get_uri(), global.create_app_launch_context(0, -1));
- - } catch (err) {
- - logError(err, 'Error opening screenshot');
- - }
- -
- - Main.overview.hide();
- - Main.panel.closeCalendar();
- - });
- - }
- -
- - Main.messageTray.add(source);
- - source.addNotification(notification);
- + // patched: do not show a notification after taking a screenshot
- return file;
- }
|