Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set device pixel ratio for grim screenshot #3604

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Copy link
Author

tobiolo commented May 12, 2024

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

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.

None yet

1 participant