[ozone] Commit the surface tree after SetShape() called [chromium/src : main]

0 views
Skip to first unread message

Thomas Lukaszewicz (Gerrit)

unread,
Sep 6, 2023, 11:12:35 PM9/6/23
to ozone-...@chromium.org

Thomas Lukaszewicz uploaded patch set #2 to this change.

View Change

[ozone] Commit the surface tree after SetShape() called

Currently SetShape() sets double buffered state on the shell surface
corresponding to the toplevel window server side [1]. This state is
applied to the root surface only after a commit is received from the
client for the surface.

In some circumstances this can lead to the shape not taking effect
immediately (see crbug.com/1158733#c29). This CL ensures that clients
propagate a commit after SetShape() has been called for the top level
window, making sure that the change occurs server-side shortly after.

[1] https://source.chromium.org/chromium/chromium/src/+/main:components/exo/shell_surface_base.h;l=448;drc=eef4762779d05708d5dfc7d5fe4ea16288069a35

Bug: 1158733, 1417600
Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
---
M ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
1 file changed, 4 insertions(+), 0 deletions(-)

To view, visit change 4846858. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
Gerrit-Change-Number: 4846858
Gerrit-PatchSet: 2
Gerrit-Owner: Thomas Lukaszewicz <tl...@chromium.org>
Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>

Thomas Lukaszewicz (Gerrit)

unread,
Sep 6, 2023, 11:16:07 PM9/6/23
to ozone-...@chromium.org, Chromium LUCI CQ, chromium...@chromium.org

Patch set 2:Commit-Queue +1

View Change

1 comment:

  • Patchset:

    • Patch Set #2:

      Oshima ptal, quick fix to ensure shape changes take effect server side shortly after they are requested by the client.

      I don't think this happens practically with existing apps using SetShape() since commits are sent regularly - but there are circumstances where the effect is not seen due to a commit not having been received on the server.

To view, visit change 4846858. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
Gerrit-Change-Number: 4846858
Gerrit-PatchSet: 2
Gerrit-Owner: Thomas Lukaszewicz <tl...@chromium.org>
Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
Gerrit-Comment-Date: Thu, 07 Sep 2023 03:15:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

Thomas Lukaszewicz (Gerrit)

unread,
Sep 6, 2023, 11:16:20 PM9/6/23
to Mitsuru Oshima, ozone-...@chromium.org

Attention is currently required from: Mitsuru Oshima.

Thomas Lukaszewicz would like Mitsuru Oshima to review this change.

View Change

[ozone] Commit the surface tree after SetShape() called

Currently SetShape() sets double buffered state on the shell surface
corresponding to the toplevel window server side [1]. This state is
applied to the root surface only after a commit is received from the
client for the surface.

In some circumstances this can lead to the shape not taking effect
immediately (see crbug.com/1158733#c29). This CL ensures that clients
propagate a commit after SetShape() has been called for the top level
window, making sure that the change occurs server-side shortly after.

[1] https://source.chromium.org/chromium/chromium/src/+/main:components/exo/shell_surface_base.h;l=448;drc=eef4762779d05708d5dfc7d5fe4ea16288069a35

Bug: 1158733, 1417600
Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
---
M ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
index 8981131..7b59c29 100644
--- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
+++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
@@ -321,6 +321,10 @@
const gfx::Transform& transform) {
if (shell_toplevel_) {
shell_toplevel_->SetShape(std::move(native_shape));
+ // The surface shape is double-buffered state maintained by the shell
+ // surface server-side and applied to the root surface. We must also commit
+ // the surface tree to ensure state is applied correctly.
+ root_surface()->Commit(false);
}
}


To view, visit change 4846858. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
Gerrit-Change-Number: 4846858
Gerrit-PatchSet: 2
Gerrit-Owner: Thomas Lukaszewicz <tl...@chromium.org>
Gerrit-Reviewer: Mitsuru Oshima <osh...@chromium.org>
Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
Gerrit-Attention: Mitsuru Oshima <osh...@chromium.org>

Thomas Lukaszewicz (Gerrit)

unread,
Sep 6, 2023, 11:31:54 PM9/6/23
to ozone-...@chromium.org

Attention is currently required from: Mitsuru Oshima.

Thomas Lukaszewicz uploaded patch set #3 to this change.

View Change

[ozone] Commit the surface tree after SetShape() called

Currently SetShape() sets double buffered state on the shell surface
corresponding to the toplevel window server side [1]. This state is
applied to the hosting widget only after a commit is received from
the client for the root surface.


In some circumstances this can lead to the shape not taking effect
immediately (see crbug.com/1158733#c29). This CL ensures that clients
propagate a commit after SetShape() has been called for the top level
window, making sure that the change occurs server-side shortly after.

[1] https://source.chromium.org/chromium/chromium/src/+/main:components/exo/shell_surface_base.h;l=448;drc=eef4762779d05708d5dfc7d5fe4ea16288069a35

Bug: 1158733, 1417600
Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
---
M ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
1 file changed, 4 insertions(+), 0 deletions(-)

To view, visit change 4846858. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
Gerrit-Change-Number: 4846858
Gerrit-PatchSet: 3

findit-for-me@appspot.gserviceaccount.com (Gerrit)

unread,
Sep 7, 2023, 12:01:25 AM9/7/23
to Thomas Lukaszewicz, ozone-...@chromium.org, Mitsuru Oshima, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Mitsuru Oshima.

This change meets the code coverage requirements.

Patch set 1:Code-Coverage +1

View Change

    To view, visit change 4846858. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
    Gerrit-Change-Number: 4846858
    Gerrit-PatchSet: 1
    Gerrit-Owner: Thomas Lukaszewicz <tl...@chromium.org>
    Gerrit-Reviewer: Mitsuru Oshima <osh...@chromium.org>
    Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
    Gerrit-Attention: Mitsuru Oshima <osh...@chromium.org>
    Gerrit-Comment-Date: Thu, 07 Sep 2023 04:01:11 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes

    Mitsuru Oshima (Gerrit)

    unread,
    Sep 7, 2023, 12:00:47 PM9/7/23
    to Thomas Lukaszewicz, ozone-...@chromium.org, findit...@appspot.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Thomas Lukaszewicz.

    View Change

    1 comment:

    • File ui/ozone/platform/wayland/host/wayland_toplevel_window.cc:

      • Patch Set #3, Line 327: root_surface()->Commit(false);

        I think we probably should have a way to tell if we're in the middle of configure, or pending commit?

    To view, visit change 4846858. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
    Gerrit-Change-Number: 4846858
    Gerrit-PatchSet: 3
    Gerrit-Owner: Thomas Lukaszewicz <tl...@chromium.org>
    Gerrit-Reviewer: Mitsuru Oshima <osh...@chromium.org>
    Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
    Gerrit-Attention: Thomas Lukaszewicz <tl...@chromium.org>
    Gerrit-Comment-Date: Thu, 07 Sep 2023 16:00:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Mitsuru Oshima (Gerrit)

    unread,
    Sep 7, 2023, 12:01:30 PM9/7/23
    to Thomas Lukaszewicz, ozone-...@chromium.org, findit...@appspot.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Thomas Lukaszewicz.

    Patch set 3:Code-Review +1

    View Change

    1 comment:

    • Patchset:

      • Patch Set #3:

        oops sent too early. This CL lgtm. I was wondering if we should have a way to commit at the end of task.

    To view, visit change 4846858. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
    Gerrit-Change-Number: 4846858
    Gerrit-PatchSet: 3
    Gerrit-Owner: Thomas Lukaszewicz <tl...@chromium.org>
    Gerrit-Reviewer: Mitsuru Oshima <osh...@chromium.org>
    Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
    Gerrit-Attention: Thomas Lukaszewicz <tl...@chromium.org>
    Gerrit-Comment-Date: Thu, 07 Sep 2023 16:01:19 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes

    Thomas Lukaszewicz (Gerrit)

    unread,
    Sep 11, 2023, 11:21:59 AM9/11/23
    to ozone-...@chromium.org

    Attention is currently required from: Thomas Lukaszewicz.

    Thomas Lukaszewicz uploaded patch set #4 to this change.

    View Change

    [ozone] Commit the surface tree after SetShape() called

    Currently SetShape() sets double buffered state on the shell surface
    corresponding to the toplevel window server side [1]. This state is
    applied to the hosting widget only after a commit is received from
    the client for the root surface.

    In some circumstances this can lead to the shape not taking effect
    immediately (see crbug.com/1158733#c29). This CL ensures that clients
    propagate a commit after SetShape() has been called for the top level
    window, making sure that the change occurs server-side shortly after.

    [1] https://source.chromium.org/chromium/chromium/src/+/main:components/exo/shell_surface_base.h;l=448;drc=eef4762779d05708d5dfc7d5fe4ea16288069a35

    Bug: 1158733, 1417600, 1481057

    Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
    ---
    M ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
    1 file changed, 4 insertions(+), 0 deletions(-)

    To view, visit change 4846858. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: newpatchset
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
    Gerrit-Change-Number: 4846858
    Gerrit-PatchSet: 4

    Thomas Lukaszewicz (Gerrit)

    unread,
    Sep 11, 2023, 11:22:09 AM9/11/23
    to ozone-...@chromium.org, Mitsuru Oshima, findit...@appspot.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Thomas Lukaszewicz.

    Patch set 4:Commit-Queue +2

    View Change

      To view, visit change 4846858. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
      Gerrit-Change-Number: 4846858
      Gerrit-PatchSet: 4
      Gerrit-Owner: Thomas Lukaszewicz <tl...@chromium.org>
      Gerrit-Reviewer: Mitsuru Oshima <osh...@chromium.org>
      Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
      Gerrit-Attention: Thomas Lukaszewicz <tl...@chromium.org>
      Gerrit-Comment-Date: Mon, 11 Sep 2023 15:21:59 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes

      findit-for-me@appspot.gserviceaccount.com (Gerrit)

      unread,
      Sep 11, 2023, 12:08:43 PM9/11/23
      to Thomas Lukaszewicz, ozone-...@chromium.org, Mitsuru Oshima, Chromium LUCI CQ, chromium...@chromium.org

      Attention is currently required from: Thomas Lukaszewicz.

      This change meets the code coverage requirements.

      Patch set 4:Code-Coverage +1

      View Change

        To view, visit change 4846858. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
        Gerrit-Change-Number: 4846858
        Gerrit-PatchSet: 4
        Gerrit-Owner: Thomas Lukaszewicz <tl...@chromium.org>
        Gerrit-Reviewer: Mitsuru Oshima <osh...@chromium.org>
        Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
        Gerrit-Attention: Thomas Lukaszewicz <tl...@chromium.org>
        Gerrit-Comment-Date: Mon, 11 Sep 2023 16:08:29 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes

        Chromium LUCI CQ (Gerrit)

        unread,
        Sep 11, 2023, 12:14:35 PM9/11/23
        to Thomas Lukaszewicz, ozone-...@chromium.org, Mitsuru Oshima, findit...@appspot.gserviceaccount.com, chromium...@chromium.org

        Chromium LUCI CQ submitted this change.

        View Change



        3 is the latest approved patch-set.
        No files were changed between the latest approved patch-set and the submitted one.

        Approvals: findit...@appspot.gserviceaccount.com: Ok Mitsuru Oshima: Looks good to me Thomas Lukaszewicz: Commit
        [ozone] Commit the surface tree after SetShape() called

        Currently SetShape() sets double buffered state on the shell surface
        corresponding to the toplevel window server side [1]. This state is
        applied to the hosting widget only after a commit is received from
        the client for the root surface.

        In some circumstances this can lead to the shape not taking effect
        immediately (see crbug.com/1158733#c29). This CL ensures that clients
        propagate a commit after SetShape() has been called for the top level
        window, making sure that the change occurs server-side shortly after.

        [1] https://source.chromium.org/chromium/chromium/src/+/main:components/exo/shell_surface_base.h;l=448;drc=eef4762779d05708d5dfc7d5fe4ea16288069a35

        Bug: 1158733, 1417600, 1481057
        Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
        Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4846858
        Reviewed-by: Mitsuru Oshima <osh...@chromium.org>
        Commit-Queue: Thomas Lukaszewicz <tl...@chromium.org>
        Code-Coverage: findit...@appspot.gserviceaccount.com <findit...@appspot.gserviceaccount.com>
        Cr-Commit-Position: refs/heads/main@{#1194886}

        ---
        M ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
        1 file changed, 4 insertions(+), 0 deletions(-)

        
        
        diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
        index 67dd8b9..414648d 100644
        --- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
        +++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
        @@ -326,6 +326,10 @@

        const gfx::Transform& transform) {
        if (shell_toplevel_) {
        shell_toplevel_->SetShape(std::move(native_shape));
        + // The surface shape is double-buffered state maintained by the shell
        + // surface server-side and applied to the root surface. We must also commit
        + // the surface tree to ensure state is applied correctly.
        + root_surface()->Commit(false);
        }
        }


        To view, visit change 4846858. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: merged
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
        Gerrit-Change-Number: 4846858
        Gerrit-PatchSet: 5
        Gerrit-Owner: Thomas Lukaszewicz <tl...@chromium.org>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Mitsuru Oshima <osh...@chromium.org>
        Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>

        Thomas Lukaszewicz (Gerrit)

        unread,
        Sep 11, 2023, 2:05:45 PM9/11/23
        to Chromium LUCI CQ, ozone-...@chromium.org, Mitsuru Oshima, findit...@appspot.gserviceaccount.com, chromium...@chromium.org

        View Change

        1 comment:

        • File ui/ozone/platform/wayland/host/wayland_toplevel_window.cc:

          • I think we probably should have a way to tell if we're in the middle of configure, or pending commit […]

            Yeah we should, I created crbug.com/1481057 to track the work needed for this and we can address this in a follow up (didn't publish comment before +2).

        To view, visit change 4846858. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I3298358d7566125e61d27619eb72e0da130958f2
        Gerrit-Change-Number: 4846858
        Gerrit-PatchSet: 5
        Gerrit-Owner: Thomas Lukaszewicz <tl...@chromium.org>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Mitsuru Oshima <osh...@chromium.org>
        Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
        Gerrit-Comment-Date: Mon, 11 Sep 2023 18:05:36 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Mitsuru Oshima <osh...@chromium.org>
        Reply all
        Reply to author
        Forward
        0 new messages