From 06b333a6e8a6523e7c6e901aa91ca9ee98fd39f0 Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Tue, 25 Mar 2025 13:55:22 +0000 Subject: [PATCH] LibWeb: Don't apply DPR or zoom level to screen.{width,height} Safari and WebKit don't apply these, while Firefox only applies the zoom level. This fixes https://x.com/ showing the tablet view. --- Libraries/LibWeb/Page/Page.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Libraries/LibWeb/Page/Page.cpp b/Libraries/LibWeb/Page/Page.cpp index 78dd115c5af..6d6188819cd 100644 --- a/Libraries/LibWeb/Page/Page.cpp +++ b/Libraries/LibWeb/Page/Page.cpp @@ -104,12 +104,11 @@ Gfx::Palette Page::palette() const CSSPixelRect Page::web_exposed_screen_area() const { auto device_pixel_rect = m_client->screen_rect(); - auto scale = client().device_pixels_per_css_pixel(); return { - device_pixel_rect.x().value() / scale, - device_pixel_rect.y().value() / scale, - device_pixel_rect.width().value() / scale, - device_pixel_rect.height().value() / scale + device_pixel_rect.x().value(), + device_pixel_rect.y().value(), + device_pixel_rect.width().value(), + device_pixel_rect.height().value() }; }