Skip to content

Commit

Permalink
Don't use the "desktop" viewport mode
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
felipeerias authored and svillar committed Jan 17, 2024
1 parent f8426c2 commit 5160ffb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5160ffb

Please sign in to comment.