Support fractional scaling constraints in GnomeDesktopResizer [chromium/src : main]

0 views
Skip to first unread message

Lambros Lambrou (Gerrit)

unread,
Jun 25, 2026, 7:02:06 PM (3 days ago) Jun 25
to Jamie Walch, chromium...@chromium.org, chromotin...@chromium.org
Attention needed from Jamie Walch

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Jamie Walch
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I227f608f7f1a823ac193e54fba207c2799a585b3
Gerrit-Change-Number: 8008491
Gerrit-PatchSet: 3
Gerrit-Owner: Lambros Lambrou <lambros...@chromium.org>
Gerrit-Reviewer: Jamie Walch <jamie...@chromium.org>
Gerrit-Attention: Jamie Walch <jamie...@chromium.org>
Gerrit-Comment-Date: Thu, 25 Jun 2026 23:01:50 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Jamie Walch (Gerrit)

unread,
Jun 25, 2026, 7:40:43 PM (3 days ago) Jun 25
to Lambros Lambrou, chromium...@chromium.org, chromotin...@chromium.org
Attention needed from Lambros Lambrou

Jamie Walch voted and added 1 comment

Votes added by Jamie Walch

Code-Review+1

1 comment

File remoting/host/linux/gnome_desktop_resizer.cc
Line 97, Patchset 3 (Latest):// in the range [1.0, 4.0], sorted in ascending order.
Jamie Walch . unresolved

Can you add a comment here explaining that the numerator needs to be small because (numerator - 1) is the maximum width/height shortfall? I'm not sure why the denominator is capped at 4. Is that a GNOME limitation?

Open in Gerrit

Related details

Attention is currently required from:
  • Lambros Lambrou
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I227f608f7f1a823ac193e54fba207c2799a585b3
    Gerrit-Change-Number: 8008491
    Gerrit-PatchSet: 3
    Gerrit-Owner: Lambros Lambrou <lambros...@chromium.org>
    Gerrit-Reviewer: Jamie Walch <jamie...@chromium.org>
    Gerrit-Attention: Lambros Lambrou <lambros...@chromium.org>
    Gerrit-Comment-Date: Thu, 25 Jun 2026 23:40:15 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lambros Lambrou (Gerrit)

    unread,
    Jun 26, 2026, 12:56:16 PM (3 days ago) Jun 26
    to Jamie Walch, chromium...@chromium.org, chromotin...@chromium.org

    Lambros Lambrou voted and added 1 comment

    Votes added by Lambros Lambrou

    Commit-Queue+2

    1 comment

    File remoting/host/linux/gnome_desktop_resizer.cc
    Line 97, Patchset 3:// in the range [1.0, 4.0], sorted in ascending order.
    Jamie Walch . resolved

    Can you add a comment here explaining that the numerator needs to be small because (numerator - 1) is the maximum width/height shortfall? I'm not sure why the denominator is capped at 4. Is that a GNOME limitation?

    Lambros Lambrou

    Done

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I227f608f7f1a823ac193e54fba207c2799a585b3
      Gerrit-Change-Number: 8008491
      Gerrit-PatchSet: 4
      Gerrit-Owner: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Reviewer: Jamie Walch <jamie...@chromium.org>
      Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Comment-Date: Fri, 26 Jun 2026 16:56:03 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Jamie Walch <jamie...@chromium.org>
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Jun 26, 2026, 1:27:00 PM (2 days ago) Jun 26
      to Lambros Lambrou, Jamie Walch, chromium...@chromium.org, chromotin...@chromium.org

      Chromium LUCI CQ submitted the change with unreviewed changes

      Unreviewed changes

      3 is the latest approved patch-set.
      The change was submitted with unreviewed changes in the following files:

      ```
      The name of the file: remoting/host/linux/gnome_desktop_resizer.cc
      Insertions: 12, Deletions: 2.

      @@ -93,8 +93,18 @@
      int denominator;
      };

      -// Valid GNOME fractional scales with denominator <= 4 and numerator <= 7,
      -// in the range [1.0, 4.0], sorted in ascending order.
      +// Valid GNOME fractional scales in the range [1.0, 4.0], sorted in ascending
      +// order.
      +//
      +// The scale list is filtered based on two constraints:
      +// 1. Denominator <= 4: GNOME 49 only supports fractional scales with
      +// denominators up to 4.
      +// 2. Numerator <= 7: GNOME 49 does not restrict the numerator, but we cap it
      +// at 7. When adjusting the physical resolution, we round it down to a
      +// multiple of the numerator. Capping the numerator at 7 guarantees that
      +// this rounding-down operation will never reduce the width or height by
      +// more than 6 pixels, ensuring the resulting resolution remains a close
      +// fit for the client's screen size.
      constexpr auto kGnomeScales = std::to_array<GnomeScale>({
      {1.0, 1, 1},
      {5.0 / 4.0, 5, 4},
      ```

      Change information

      Commit message:
      Support fractional scaling constraints in GnomeDesktopResizer

      This CL updates GnomeDesktopResizer::GetSupportedResolutions to
      support GNOME's fractional scaling constraints (introduced in
      GNOME 49+).

      Specifically, GNOME requires:
      1. The logical dimensions to be integers. This means the physical
      resolution width and height must be cleanly divisible by the
      numerator of the fractional scale.
      2. The logical area to be at least 600x600 (360,000 pixels).

      To satisfy this, GetSupportedResolutions now:
      - Identifies the requested scale factor from the preferred
      resolution's DPI.
      - Finds the closest matching GNOME-supported fractional scale
      (denominator <= 4, numerator <= 7).
      - Rounds the preferred physical dimensions down to the nearest
      multiple of the numerator (using rounded_w and rounded_h).
      - Verifies if the resulting logical area meets the 360,000-pixel
      minimum.
      - If not, falls back to the next smaller supported scale,
      ultimately falling back to 1.0x if no other scale works.
      - Uses pure integer math for precision and safety.

      Additionally, this CL:
      - Removes the legacy rounding-down-to-even-numbers logic in
      ClientSession::NotifyClientResolution since WebRTC now handles
      odd dimensions and it could interfere with GNOME's custom
      rounding.
      - Adds comprehensive unit tests in gnome_desktop_resizer_unittest.cc
      to verify these behaviors.

      TAG=agy
      CONV=882ebc64-65bf-4d51-a547-0caf8a82fa9f
      Bug: 431816005
      Change-Id: I227f608f7f1a823ac193e54fba207c2799a585b3
      Reviewed-by: Jamie Walch <jamie...@chromium.org>
      Commit-Queue: Lambros Lambrou <lambros...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1653262}
      Files:
      • M remoting/host/client_session.cc
      • M remoting/host/linux/gnome_desktop_resizer.cc
      • M remoting/host/linux/gnome_desktop_resizer_unittest.cc
      Change size: M
      Delta: 3 files changed, 144 insertions(+), 19 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Jamie Walch
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I227f608f7f1a823ac193e54fba207c2799a585b3
      Gerrit-Change-Number: 8008491
      Gerrit-PatchSet: 5
      Gerrit-Owner: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages