From 5160ffb1de63bebc7702cdf89a1522d95ab5b67d Mon Sep 17 00:00:00 2001 From: Felipe Erias Date: Wed, 17 Jan 2024 15:54:44 +0900 Subject: [PATCH] Don't use the "desktop" viewport mode In the "desktop" viewport mode, the Web engine renders pages inside a special fixed-width viewport which is 980 CSS px wide. Pages rendered on the "desktop" viewport mode keep their fixed width when the containing window becomes larger, which is not very useful. Furthermore, since we increased the screen density used by Wolvic, this fixed width is actually smaller than our current default. For these reasons, this PR removes usages of the "desktop" viewport mode. Note that "desktop mode" will still exist, but it will only affect the User-Agent and not the viewport configuration. --- .../shared/com/igalia/wolvic/browser/engine/Session.java | 5 ----- .../com/igalia/wolvic/browser/engine/SessionSettings.java | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/src/common/shared/com/igalia/wolvic/browser/engine/Session.java b/app/src/common/shared/com/igalia/wolvic/browser/engine/Session.java index 2da4ffc7e5b..d9750939694 100644 --- a/app/src/common/shared/com/igalia/wolvic/browser/engine/Session.java +++ b/app/src/common/shared/com/igalia/wolvic/browser/engine/Session.java @@ -1008,11 +1008,6 @@ private boolean trySetUaMode(int mode) { } mState.mSettings.setUserAgentMode(mode); mState.mSession.getSettings().setUserAgentMode(mode); - if (mode == WSessionSettings.USER_AGENT_MODE_DESKTOP) { - mState.mSettings.setViewportMode(WSessionSettings.VIEWPORT_MODE_DESKTOP); - } else { - mState.mSettings.setViewportMode(WSessionSettings.VIEWPORT_MODE_MOBILE); - } mState.mSession.getSettings().setViewportMode(mState.mSettings.getViewportMode()); return true; } diff --git a/app/src/common/shared/com/igalia/wolvic/browser/engine/SessionSettings.java b/app/src/common/shared/com/igalia/wolvic/browser/engine/SessionSettings.java index 91fd6e6e599..e6e3ff955a8 100644 --- a/app/src/common/shared/com/igalia/wolvic/browser/engine/SessionSettings.java +++ b/app/src/common/shared/com/igalia/wolvic/browser/engine/SessionSettings.java @@ -110,8 +110,7 @@ public Builder withUserAgentOverride(String userAgentOverride) { public Builder withDefaultSettings(Context context) { int ua = SettingsStore.getInstance(context).getUaMode(); - int viewport = ua == WSessionSettings.USER_AGENT_MODE_DESKTOP ? - WSessionSettings.VIEWPORT_MODE_DESKTOP : WSessionSettings.VIEWPORT_MODE_MOBILE; + int viewport = WSessionSettings.VIEWPORT_MODE_MOBILE; TrackingProtectionPolicy policy = TrackingProtectionStore.getTrackingProtectionPolicy(context); return new SessionSettings.Builder()