Skip to content

Conversation

@tobiolo
Copy link

@tobiolo tobiolo commented May 12, 2024

Grim returns a bitmap with the physical size of the screen. This needs to be scaled back to be displayed as underlay for Flameshot on screens where logical size differs from the physical size (i.e. scale is active).

In order to do this, set the device pixel ratio, see https://doc.qt.io/qt-5/qpixmap.html#setDevicePixelRatio.

Please note that this works only properly with integer scale. QScreen::devicePixelRatio rounds when fractional scale is active on Wayland.

@tobiolo tobiolo force-pushed the wayland-grim-pixmap-setdevicepixelratio branch from 71ae078 to c80ed93 Compare May 12, 2024 16:16
Grim returns a bitmap with the physical size of the screen.
This needs to be scaled back to be displayed as underlay for Flameshot
on screens where logical size differs from the physical size (i.e. scale is active).

In order to do this, set the device pixel ratio, see
<https://doc.qt.io/qt-5/qpixmap.html#setDevicePixelRatio>.

Please note that this works only properly with integer scale.
`QScreen::devicePixelRatio()` rounds when fractional scale is active
on Wayland (because fractional scale is not yet supported by qtWayland).
@tobiolo tobiolo force-pushed the wayland-grim-pixmap-setdevicepixelratio branch from c80ed93 to 8f3c80f Compare May 12, 2024 20:23
@tobiolo
Copy link
Author

tobiolo commented May 12, 2024

Note: It should be this or #3606, but not both.

@borgmanJeremy
Copy link
Collaborator

What happens if fractional scaling is set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants