Chromium Code Reviews| Index: ui/ozone/platform/wayland/wayland_connection.cc |
| diff --git a/ui/ozone/platform/wayland/wayland_connection.cc b/ui/ozone/platform/wayland/wayland_connection.cc |
| index 2e445d9f2560114fcc20043ced6dd1cb904b5fb2..187ffdf11019ea576402f419a10b86a6ce29b777 100644 |
| --- a/ui/ozone/platform/wayland/wayland_connection.cc |
| +++ b/ui/ozone/platform/wayland/wayland_connection.cc |
| @@ -10,6 +10,7 @@ |
| #include "base/logging.h" |
| #include "base/memory/ptr_util.h" |
| #include "base/message_loop/message_loop.h" |
| +#include "ui/ozone/platform/wayland/wayland_object.h" |
| #include "ui/ozone/platform/wayland/wayland_window.h" |
| static_assert(XDG_SHELL_VERSION_CURRENT == 5, "Unsupported xdg-shell version"); |
| @@ -105,6 +106,12 @@ void WaylandConnection::RemoveWindow(gfx::AcceleratedWidget widget) { |
| window_map_.erase(widget); |
| } |
| +WaylandOutput* WaylandConnection::PrimaryOutput() const { |
| + if (!output_list_.size()) |
| + return nullptr; |
| + return output_list_.front().get(); |
| +} |
| + |
| void WaylandConnection::OnDispatcherListChanged() { |
| StartProcessingEvents(); |
| } |
| @@ -126,6 +133,11 @@ void WaylandConnection::OnFileCanReadWithoutBlocking(int fd) { |
| void WaylandConnection::OnFileCanWriteWithoutBlocking(int fd) {} |
| +const std::vector<std::unique_ptr<WaylandOutput>>& |
| +WaylandConnection::GetOutputList() const { |
| + return output_list_; |
| +} |
| + |
| // static |
| void WaylandConnection::Global(void* data, |
| wl_registry* registry, |
| @@ -169,6 +181,18 @@ void WaylandConnection::Global(void* data, |
| connection); |
| xdg_shell_use_unstable_version(connection->shell_.get(), |
| XDG_SHELL_VERSION_CURRENT); |
| + } else if (strcmp(interface, "wl_output") == 0) { |
|
rjkroege
2016/09/25 14:44:31
nit: Chrome style is probably to use something fro
joone
2016/09/27 08:25:20
Done.
|
| + wl::Object<wl_output> output = wl::Bind<wl_output>(registry, name, 1); |
| + if (!output) { |
| + LOG(ERROR) << "Failed to bind to wl_output global"; |
| + return; |
| + } |
| + |
| + if (!connection->output_list_.empty()) |
| + NOTIMPLEMENTED() << "Multiple screens support is not implemented"; |
| + |
| + connection->output_list_.push_back( |
| + base::WrapUnique(new WaylandOutput(output.release()))); |
| } |
| connection->ScheduleFlush(); |