|
@@ -543,8 +543,11 @@ void WebContentView::update_screen_rects()
|
|
if (!screens.empty()) {
|
|
if (!screens.empty()) {
|
|
Vector<Web::DevicePixelRect> screen_rects;
|
|
Vector<Web::DevicePixelRect> screen_rects;
|
|
for (auto const& screen : screens) {
|
|
for (auto const& screen : screens) {
|
|
|
|
+ // NOTE: QScreen::geometry() returns the 'device-independent pixels', we multiply
|
|
|
|
+ // by the device pixel ratio to get the 'physical pixels' of the display.
|
|
auto geometry = screen->geometry();
|
|
auto geometry = screen->geometry();
|
|
- screen_rects.append(Web::DevicePixelRect(geometry.x(), geometry.y(), geometry.width(), geometry.height()));
|
|
|
|
|
|
+ auto device_pixel_ratio = screen->devicePixelRatio();
|
|
|
|
+ screen_rects.append(Web::DevicePixelRect(geometry.x(), geometry.y(), geometry.width() * device_pixel_ratio, geometry.height() * device_pixel_ratio));
|
|
}
|
|
}
|
|
|
|
|
|
// NOTE: The first item in QGuiApplication::screens is always the primary screen.
|
|
// NOTE: The first item in QGuiApplication::screens is always the primary screen.
|