diff options
author | Roger Zanoni <rzanoni@igalia.com> | 2021-06-25 11:13:51 +0200 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2021-06-29 22:05:59 +0000 |
commit | bd0b678a9f35e7ec92862a81575ffc6d32ad2508 (patch) | |
tree | c84a51617053a037c6b1336999233a3cbba3a741 /recipes-wam/chromium/files/add-a-delay-to-agl-ready-event.patch | |
parent | 6e44449dadb99d905a5a9e7fdb7a799785c56f8a (diff) |
chromium84: Add a delay to agl ready eventmarlin_12.90.0marlin/12.90.012.90.0
Delay ready() to ensure that all the window and surfaces setup
is done before notifying the compositor
There's a work in progress for enabling wam to display multiple
surfaces for a single widget, which would eliminate the chain
loading that currently causes this issue.
This change includes a temporary patch that should be removed
once wam changes are integrated.
Bug-AGL: SPEC-3799
Signed-off-by: Roger Zanoni <rzanoni@igalia.com>
Change-Id: I9945af60077a79d56052c3fdb358e9fed44874e6
Diffstat (limited to 'recipes-wam/chromium/files/add-a-delay-to-agl-ready-event.patch')
-rw-r--r-- | recipes-wam/chromium/files/add-a-delay-to-agl-ready-event.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/recipes-wam/chromium/files/add-a-delay-to-agl-ready-event.patch b/recipes-wam/chromium/files/add-a-delay-to-agl-ready-event.patch new file mode 100644 index 000000000..20caccbf6 --- /dev/null +++ b/recipes-wam/chromium/files/add-a-delay-to-agl-ready-event.patch @@ -0,0 +1,70 @@ +From d2d09d3e13a3874961971d343553106a1f3d5ac7 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni <rzanoni@igalia.com> +Date: Thu, 3 Jun 2021 10:53:40 +0200 +Subject: [PATCH] Add a delay to agl ready event + +Delay ready() to ensure that all the window and surfaces setup +is done before notifying the compositor +--- + .../ozone/platform/wayland/host/wayland_window.cc | 14 +++++++++++++- + .../ozone/platform/wayland/host/wayland_window.h | 5 +++++ + 2 files changed, 18 insertions(+), 1 deletion(-) + +diff --git a/src/ui/ozone/platform/wayland/host/wayland_window.cc b/src/ui/ozone/platform/wayland/host/wayland_window.cc +index d2a9b0dae5..27749fd70d 100644 +--- a/src/ui/ozone/platform/wayland/host/wayland_window.cc ++++ b/src/ui/ozone/platform/wayland/host/wayland_window.cc +@@ -299,7 +299,19 @@ WaylandWindow::SetAglReady(void) + if (!connection_->agl_shell_manager) { + return; + } +- connection_->agl_shell_manager->ready(); ++ ++ // Delay activation to ensure that all the setup is done ++ // TODO(rzanoni): find a more deterministic way of doing this ++ set_ready_timer_.Start(FROM_HERE, ++ base::TimeDelta::FromMilliseconds(500), ++ this, ++ &WaylandWindow::SetReadyCallback); ++} ++ ++ ++void WaylandWindow::SetReadyCallback() { ++ connection_->agl_shell_manager->ready(); ++ connection_->ScheduleFlush(); + } + + bool WaylandWindow::CanDispatchEvent(const PlatformEvent& event) { +diff --git a/src/ui/ozone/platform/wayland/host/wayland_window.h b/src/ui/ozone/platform/wayland/host/wayland_window.h +index 2acac98ae9..c10db38d21 100644 +--- a/src/ui/ozone/platform/wayland/host/wayland_window.h ++++ b/src/ui/ozone/platform/wayland/host/wayland_window.h +@@ -15,6 +15,7 @@ + #include "base/containers/flat_set.h" + #include "base/gtest_prod_util.h" + #include "base/memory/ref_counted.h" ++#include "base/timer/timer.h" + #include "ui/events/platform/platform_event_dispatcher.h" + #include "ui/gfx/geometry/rect.h" + #include "ui/gfx/native_widget_types.h" +@@ -232,6 +233,8 @@ class WaylandWindow : public PlatformWindow, public PlatformEventDispatcher { + // Returns a root parent window. + WaylandWindow* GetRootParentWindow(); + ++ void SetReadyCallback(); ++ + // Install a surface listener and start getting wl_output enter/leave events. + void AddSurfaceListener(); + +@@ -311,6 +314,8 @@ class WaylandWindow : public PlatformWindow, public PlatformEventDispatcher { + // The type of the current WaylandWindow object. + ui::PlatformWindowType type_ = ui::PlatformWindowType::kWindow; + ++ base::OneShotTimer set_ready_timer_; ++ + DISALLOW_COPY_AND_ASSIGN(WaylandWindow); + }; + +-- +2.32.0 + |