From 9137aef0d1772f5ff693d972174379c8d648223f Mon Sep 17 00:00:00 2001 From: mae <26093674+MaeIsBad@users.noreply.github.com> Date: Sat, 5 Oct 2024 15:26:48 +0200 Subject: [PATCH] Disable grims png compression Grim by default used level 6 for compressing PDFs, which could take as long as a second depending on the hardware. This caused a big delay when taking a screenshot with grim, leading to a bad user experience. This commit sets the compression level to 0(uncompressed) radically speeding up the process of taking a screenshot. --- src/utils/screengrabber.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/screengrabber.cpp b/src/utils/screengrabber.cpp index 9ce3854f43..d1091243ab 100644 --- a/src/utils/screengrabber.cpp +++ b/src/utils/screengrabber.cpp @@ -34,6 +34,8 @@ void ScreenGrabber::generalGrimScreenshot(bool& ok, QPixmap& res) QProcess Process; QString program = "grim"; QStringList arguments; + // Disable PNG compression + arguments << "-l" << "0"; arguments << "-"; Process.start(program, arguments); if (Process.waitForFinished()) {