forked from mirrors/nixpkgs
a8affa912c
This is 843508dad4
for M97 (upstream didn't backport them so far).
32 lines
1.2 KiB
Diff
32 lines
1.2 KiB
Diff
diff --git a/ui/ozone/platform/wayland/host/surface_augmenter.cc b/ui/ozone/platform/wayland/host/surface_augmenter.cc
|
|
index d971d15e71426..6e5408398bcea 100644
|
|
--- a/ui/ozone/platform/wayland/host/surface_augmenter.cc
|
|
+++ b/ui/ozone/platform/wayland/host/surface_augmenter.cc
|
|
@@ -13,7 +13,8 @@
|
|
namespace ui {
|
|
|
|
namespace {
|
|
-constexpr uint32_t kMaxSurfaceAugmenterVersion = 1;
|
|
+constexpr uint32_t kMinVersion = 1;
|
|
+constexpr uint32_t kMaxVersion = 1;
|
|
}
|
|
|
|
// static
|
|
@@ -27,11 +28,13 @@ void SurfaceAugmenter::Instantiate(WaylandConnection* connection,
|
|
uint32_t version) {
|
|
DCHECK_EQ(interface, kInterfaceName);
|
|
|
|
- if (connection->surface_augmenter_)
|
|
+ if (connection->surface_augmenter_ ||
|
|
+ !wl::CanBind(interface, version, kMinVersion, kMaxVersion)) {
|
|
return;
|
|
+ }
|
|
|
|
- auto augmenter = wl::Bind<surface_augmenter>(
|
|
- registry, name, std::min(version, kMaxSurfaceAugmenterVersion));
|
|
+ auto augmenter = wl::Bind<surface_augmenter>(registry, name,
|
|
+ std::min(version, kMaxVersion));
|
|
if (!augmenter) {
|
|
LOG(ERROR) << "Failed to bind surface_augmenter";
|
|
return;
|