Commit 543b0c5e authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

exo: Use interface versions directly for zcr_ interfaces

For zcr_ interfaces, protocol definitions are always updated in the
same CL of the corresponding exo change, and there's no risk of the
implementation being behind the definition xml. In fact, it is
error-prone that we always have to update versions in two places, so
let's just cosolidate them.

TEST=tast run eve-DUT arc.Boot
BUG=None

Change-Id: I802422292fa860dc7347e440fe9f0db2ecd046f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2138851Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757699}
parent bcb242a7
...@@ -163,14 +163,15 @@ Server::Server(Display* display) ...@@ -163,14 +163,15 @@ Server::Server(Display* display)
wl_global_create(wl_display_.get(), &zcr_gaming_input_v2_interface, 1, wl_global_create(wl_display_.get(), &zcr_gaming_input_v2_interface, 1,
display_, bind_gaming_input); display_, bind_gaming_input);
wl_global_create(wl_display_.get(), &zcr_keyboard_configuration_v1_interface, wl_global_create(wl_display_.get(), &zcr_keyboard_configuration_v1_interface,
kZcrKeyboardConfigurationVersion, display_, zcr_keyboard_configuration_v1_interface.version, display_,
bind_keyboard_configuration); bind_keyboard_configuration);
wl_global_create(wl_display_.get(), &zcr_keyboard_extension_v1_interface, 1, wl_global_create(wl_display_.get(), &zcr_keyboard_extension_v1_interface, 1,
display_, bind_keyboard_extension); display_, bind_keyboard_extension);
wl_global_create(wl_display_.get(), &zcr_notification_shell_v1_interface, 1, wl_global_create(wl_display_.get(), &zcr_notification_shell_v1_interface, 1,
display_, bind_notification_shell); display_, bind_notification_shell);
wl_global_create(wl_display_.get(), &zcr_remote_shell_v1_interface, wl_global_create(wl_display_.get(), &zcr_remote_shell_v1_interface,
kZcrRemoteShellVersion, display_, bind_remote_shell); zcr_remote_shell_v1_interface.version, display_,
bind_remote_shell);
wl_global_create(wl_display_.get(), &zcr_stylus_tools_v1_interface, 1, wl_global_create(wl_display_.get(), &zcr_stylus_tools_v1_interface, 1,
display_, bind_stylus_tools); display_, bind_stylus_tools);
wl_global_create(wl_display_.get(), wl_global_create(wl_display_.get(),
......
...@@ -127,7 +127,9 @@ void bind_keyboard_configuration(wl_client* client, ...@@ -127,7 +127,9 @@ void bind_keyboard_configuration(wl_client* client,
uint32_t id) { uint32_t id) {
wl_resource* resource = wl_resource_create( wl_resource* resource = wl_resource_create(
client, &zcr_keyboard_configuration_v1_interface, client, &zcr_keyboard_configuration_v1_interface,
std::min(version, kZcrKeyboardConfigurationVersion), id); std::min<uint32_t>(version,
zcr_keyboard_configuration_v1_interface.version),
id);
wl_resource_set_implementation( wl_resource_set_implementation(
resource, &keyboard_configuration_implementation, data, nullptr); resource, &keyboard_configuration_implementation, data, nullptr);
} }
......
...@@ -12,8 +12,6 @@ struct wl_client; ...@@ -12,8 +12,6 @@ struct wl_client;
namespace exo { namespace exo {
namespace wayland { namespace wayland {
constexpr uint32_t kZcrKeyboardConfigurationVersion = 2;
void bind_keyboard_configuration(wl_client* client, void bind_keyboard_configuration(wl_client* client,
void* data, void* data,
uint32_t version, uint32_t version,
......
...@@ -1318,9 +1318,9 @@ void bind_remote_shell(wl_client* client, ...@@ -1318,9 +1318,9 @@ void bind_remote_shell(wl_client* client,
void* data, void* data,
uint32_t version, uint32_t version,
uint32_t id) { uint32_t id) {
wl_resource* resource = wl_resource* resource = wl_resource_create(
wl_resource_create(client, &zcr_remote_shell_v1_interface, client, &zcr_remote_shell_v1_interface,
std::min(version, kZcrRemoteShellVersion), id); std::min<uint32_t>(version, zcr_remote_shell_v1_interface.version), id);
SetImplementation(resource, &remote_shell_implementation, SetImplementation(resource, &remote_shell_implementation,
std::make_unique<WaylandRemoteShell>( std::make_unique<WaylandRemoteShell>(
......
...@@ -22,8 +22,6 @@ class Display; ...@@ -22,8 +22,6 @@ class Display;
namespace exo { namespace exo {
namespace wayland { namespace wayland {
constexpr uint32_t kZcrRemoteShellVersion = 27;
void bind_remote_shell(wl_client* client, void bind_remote_shell(wl_client* client,
void* data, void* data,
uint32_t version, uint32_t version,
......
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