Index: ui/ozone/platform/wayland/fake_server.cc |
diff --git a/ui/ozone/platform/wayland/fake_server.cc b/ui/ozone/platform/wayland/fake_server.cc |
index baafedc30e32cae8b5c0a3795aa35fcfaaf00a98..52424c96365ad96abe238f5ac099b637028945ff 100644 |
--- a/ui/ozone/platform/wayland/fake_server.cc |
+++ b/ui/ozone/platform/wayland/fake_server.cc |
@@ -18,6 +18,7 @@ namespace wl { |
namespace { |
const uint32_t kCompositorVersion = 4; |
+const uint32_t kOutputVersion = 2; |
const uint32_t kSeatVersion = 4; |
const uint32_t kXdgShellVersion = 1; |
@@ -278,6 +279,7 @@ void Global::Bind(wl_client* client, |
global->resource_ = resource; |
wl_resource_set_implementation(resource, global->implementation_, global, |
&Global::OnResourceDestroyed); |
+ global->OnBind(); |
} |
// static |
@@ -296,6 +298,21 @@ void MockCompositor::AddSurface(std::unique_ptr<MockSurface> surface) { |
surfaces_.push_back(std::move(surface)); |
} |
+MockOutput::MockOutput() |
+ : Global(&wl_output_interface, nullptr, kOutputVersion) {} |
+ |
+MockOutput::~MockOutput() {} |
+ |
+// Notify clients of the change for output position. |
+void MockOutput::OnBind() { |
+ const char* kUnknownMake = "unknown"; |
+ const char* kUnknownModel = "unknown"; |
+ wl_output_send_geometry(resource(), rect_.x(), rect_.y(), 0, 0, 0, |
+ kUnknownMake, kUnknownModel, 0); |
+ wl_output_send_mode(resource(), WL_OUTPUT_MODE_CURRENT, rect_.width(), |
+ rect_.height(), 0); |
+} |
+ |
MockSeat::MockSeat() : Global(&wl_seat_interface, &seat_impl, kSeatVersion) {} |
MockSeat::~MockSeat() {} |
@@ -337,6 +354,8 @@ bool FakeServer::Start() { |
return false; |
if (!compositor_.Initialize(display_.get())) |
return false; |
+ if (!output_.Initialize(display_.get())) |
+ return false; |
if (!seat_.Initialize(display_.get())) |
return false; |
if (!xdg_shell_.Initialize(display_.get())) |