ui/gfx/x: Peek at X11 responses in GeometryCache::GetBoundsPx() [chromium/src : main]

0 views
Skip to first unread message

Thomas Anderson (Gerrit)

unread,
Jul 20, 2026, 10:01:45 PM (2 days ago) Jul 20
to Chromium LUCI CQ, Lei Zhang, chromium...@chromium.org, ozone-...@chromium.org

Thomas Anderson voted and added 8 comments

Votes added by Thomas Anderson

Auto-Submit+1
Commit-Queue+1

8 comments

Commit Message
Line 7, Patchset 2:ui/gfx/x: Peek X11 responses in GeometryCache::GetBoundsPx()
Lei Zhang . resolved

"Peek at" ?

Thomas Anderson

Done

File ui/gfx/x/future.h
Line 139, Patchset 2: ReadBuffer buf(raw_reply);
Lei Zhang . resolved

Make line 119 consistent along the way?

Thomas Anderson

Done

Line 126, Patchset 2: // Blocks until we receive the response from the server. Returns the response
Lei Zhang . resolved

go/avoid-we

Thomas Anderson

Done

Line 31, Patchset 2: void Peek(RawReply* raw_reply, std::unique_ptr<Error>* error);
Lei Zhang . resolved

Document how this is different from Sync().

Thomas Anderson

Done

File ui/gfx/x/future.cc
Line 41, Patchset 2: DCHECK_CALLED_ON_VALID_SEQUENCE(connection_->sequence_checker_);
Lei Zhang . resolved

Do this first?

Thomas Anderson

Done

File ui/gfx/x/geometry_cache.cc
Line 37, Patchset 2: gfx::Rect geometry = geometry_;
Lei Zhang . resolved

Should not assign since line 39 does it.

Thomas Anderson

Done

Line 46, Patchset 2: if (!have_parent_) {
Lei Zhang . resolved

The pre-existing code did this check first. Is this flipped around on purpose?

Thomas Anderson

Changed back to original order.

Line 60, Patchset 2: return geometry;
Lei Zhang . resolved

Flip conditional on line 47 and return early?

Thomas Anderson

Done

Open in Gerrit

Related details

Attention set is empty
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: I44d459c8fe3fffd052d7380598c9b4d98d3d3a11
Gerrit-Change-Number: 8128859
Gerrit-PatchSet: 3
Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
Gerrit-Comment-Date: Tue, 21 Jul 2026 02:01:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Jul 20, 2026, 10:17:17 PM (2 days ago) Jul 20
to Thomas Anderson, Lei Zhang, Chromium LUCI CQ, chromium...@chromium.org, ozone-...@chromium.org
Attention needed from Thomas Anderson

Lei Zhang voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Thomas Anderson
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: I44d459c8fe3fffd052d7380598c9b4d98d3d3a11
    Gerrit-Change-Number: 8128859
    Gerrit-PatchSet: 4
    Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-Attention: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-Comment-Date: Tue, 21 Jul 2026 02:17:01 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Thomas Anderson (Gerrit)

    unread,
    Jul 21, 2026, 10:53:11 AM (2 days ago) Jul 21
    to Lei Zhang, Chromium LUCI CQ, chromium...@chromium.org, ozone-...@chromium.org

    Thomas Anderson voted Commit-Queue+2

    Commit-Queue+2
    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: I44d459c8fe3fffd052d7380598c9b4d98d3d3a11
    Gerrit-Change-Number: 8128859
    Gerrit-PatchSet: 4
    Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-Comment-Date: Tue, 21 Jul 2026 14:52:58 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Jul 21, 2026, 10:57:26 AM (2 days ago) Jul 21
    to Thomas Anderson, Lei Zhang, chromium...@chromium.org, ozone-...@chromium.org

    Chromium LUCI CQ submitted the change

    Change information

    Commit message:
    ui/gfx/x: Peek at X11 responses in GeometryCache::GetBoundsPx()

    GeometryCache::GetBoundsPx() previously called DispatchNow() to wait for
    and process parent/geometry responses. This triggered synchronous
    callbacks, causing out-of-order event dispatch and re-entrancy issues
    (crbug.com/524439798, crbug.com/524824288, crbug.com/532966375).

    This change adds a Peek() method to x11::Future and x11::FutureImpl
    which blocks until the reply is available from the X server without
    taking the response from the connection queue or clearing/dispatching
    the response callback.

    GeometryCache::GetBoundsPx() now uses Peek() to synchronously read the
    parent window and geometry data for bounds calculation without
    dispatching events or calling bounds-changed callbacks. The callbacks
    are invoked in order when the event loop processes the responses from
    the connection queue.
    Fixed: 524439798, 524824288, 532966375
    Change-Id: I44d459c8fe3fffd052d7380598c9b4d98d3d3a11
    Reviewed-by: Lei Zhang <the...@chromium.org>
    Auto-Submit: Thomas Anderson <thomasa...@chromium.org>
    Commit-Queue: Thomas Anderson <thomasa...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1665486}
    Files:
    • M ui/gfx/x/future.cc
    • M ui/gfx/x/future.h
    • M ui/gfx/x/geometry_cache.cc
    • M ui/gfx/x/geometry_cache_unittest.cc
    • M ui/ozone/platform/x11/x11_window_ozone_unittest.cc
    Change size: M
    Delta: 5 files changed, 101 insertions(+), 51 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Lei Zhang
    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: I44d459c8fe3fffd052d7380598c9b4d98d3d3a11
    Gerrit-Change-Number: 8128859
    Gerrit-PatchSet: 5
    Gerrit-Owner: Thomas Anderson <thomasa...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Thomas Anderson <thomasa...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages