Advertisement
Guest User

flameshot-wayland-dpi-fix.patch

a guest
Aug 7th, 2023
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.92 KB | Source Code | 0 0
  1. diff --git a/src/utils/screengrabber.cpp b/src/utils/screengrabber.cpp
  2. index d0d1bec..4fe73b4 100644
  3. --- a/src/utils/screengrabber.cpp
  4. +++ b/src/utils/screengrabber.cpp
  5. @@ -49,13 +49,13 @@ void ScreenGrabber::freeDesktopPortal(bool& ok, QPixmap& res)
  6.        this);
  7.  
  8.      QEventLoop loop;
  9. -    const auto gotSignal = [&res, &loop](uint status, const QVariantMap& map) {
  10. +    const auto gotSignal = [this, &res, &loop](uint status, const QVariantMap& map) {
  11.          if (status == 0) {
  12.              // Parse this as URI to handle unicode properly
  13.              QUrl uri = map.value("uri").toString();
  14.              QString uriString = uri.toLocalFile();
  15.              res = QPixmap(uriString);
  16. -            res.setDevicePixelRatio(qApp->devicePixelRatio());
  17. +            res.setDevicePixelRatio(res.width() / double(desktopGeometry().width()));
  18.              QFile imgFile(uriString);
  19.              imgFile.remove();
  20.          }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement