Commit aafaeb84 authored by Eliot Courtney's avatar Eliot Courtney Committed by Commit Bot

[ozone/wayland] Remove no-op set_user_data from WaylandSurface.

The user data is written by add_listener, and having a separate call to
set_user_data setting the same thing is confusing because it implies
that you could use set_user_data to set a different value than to what
you use in the listener.

Bug: None
Test: compiles
Change-Id: I34f6b87367f8a34b96160169fc531113001267a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2368619
Commit-Queue: Eliot Courtney <edcourtney@chromium.org>
Reviewed-by: default avatarMaksim Sisov (GMT+3) <msisov@igalia.com>
Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800925}
parent e32bd4c3
......@@ -15,12 +15,7 @@ WaylandSurface::WaylandSurface(WaylandConnection* connection,
root_window_(root_window),
surface_(connection->CreateSurface()) {}
WaylandSurface::~WaylandSurface() {
if (surface_) {
wl_surface_add_listener(surface_.get(), nullptr, nullptr);
wl_surface_set_user_data(surface_.get(), nullptr);
}
}
WaylandSurface::~WaylandSurface() = default;
uint32_t WaylandSurface::GetSurfaceId() const {
if (!surface_)
......@@ -36,8 +31,6 @@ bool WaylandSurface::Initialize() {
if (!surface_)
return false;
wl_surface_set_user_data(surface_.get(), this);
static struct wl_surface_listener surface_listener = {
&WaylandSurface::Enter,
&WaylandSurface::Leave,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment