Skip to content

Commit

Permalink
Disable grims png compression
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MaeIsBad committed Oct 5, 2024
1 parent 14a1367 commit 9137aef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils/screengrabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 9137aef

Please sign in to comment.