flameshot-org / flameshot-org/flameshot-org.github.io

GNOME+Wayland, Slow Screenshot on 3x4k, Flash and Shutter Sound

Open
#217 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
SCSS
Stars
33
Forks
51
PR merge metrics
No merged PRs in 30d

Description

Not a Bug, more a how I fixed/improved it, and to be helpful for others https://flameshot.org/docs/guide/wayland-help

## 1. Slow Screenshot on 3x 4k

In Gnome-Shell with Wayland Screenshots are done via the `ScreenshotAsync` method.
The method creates a File-Stream where the Screenshot is written to, and Flameshot (or any other tool) can get it from.
For 3x4k Screens the slow part i found, is the encoding and writing to disk.
Currently I have not found a easy way to make the encoding faster.
To make the writing to disk faster I mounted a Ram-Disk to location.

The file is created under `$HOME/Pictures/Screenshot.png`, so because i don't use the Pictures directory at all
```bash
mount -t tmpfs -o size=512M ramdisk $HOME/Pictures
```

❗❗❗ This is a tmpfs. All content inside will be gone after a reboot❗❗❗

Source Code:
- `ScreenshotAsync` https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/screenshot.js?ref_type=heads#L2717
- `_createStream` https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/screenshot.js?ref_type=heads#L2712

## 2. Flash an Shutter Sound

This same method triggers a white flash animation and a shutter sound that cannot be disabled.
There is a issue ( https://gitlab.gnome.org/GNOME/gnome-shell/-/work_items/3866 ) that this could be problematic to users.

As the triggering code is in the JS part of GNOME it can be patched with a Extension.
https://extensions.gnome.org/extension/10009/disable-screenshot-flash-and-sound/
The Extension patches the `ScreenshotAsync` methode to be called with parameter `flash=false` all the time.

- `ScreenshotAsync` https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/screenshot.js?ref_type=heads#L2717
- `_flashAsync` https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/screenshot.js?ref_type=heads#L2606

## Versions

```bash
$ gnome-shell --version
GNOME Shell 50.1

$ flameshot --version
Flameshot v12.1.0 ()
Compiled with Qt 5.15.2
```
(I use a old version yes, i don't like the monitor select, notes still apply)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.