Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Unified Diff: components/exo/wayland/server.cc

Issue 2572963002: exo: Produce an error if stylus delegate is already associated. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/exo/pointer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/wayland/server.cc
diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc
index 3b754f5776df8ad3cfaff64d07c7f334775fc6fb..bec1fe4f66ae8b6eea957ffa8e4be99b2b1a0085 100644
--- a/components/exo/wayland/server.cc
+++ b/components/exo/wayland/server.cc
@@ -2986,8 +2986,13 @@ void stylus_get_pointer_stylus(wl_client* client,
wl_resource* resource,
uint32_t id,
wl_resource* pointer_resource) {
- // TODO(yhanada): Produce an erorr if a delegate already exists.
Pointer* pointer = GetUserDataAs<Pointer>(pointer_resource);
+ if (pointer->HasStylusDelegate()) {
+ wl_resource_post_error(
+ resource, ZCR_STYLUS_V1_ERROR_POINTER_STYLUS_EXISTS,
+ "pointer has already been associated with a stylus object");
+ return;
+ }
wl_resource* stylus_resource =
wl_resource_create(client, &zcr_pointer_stylus_v1_interface, 1, id);
@@ -3132,7 +3137,7 @@ Server::Server(Display* display)
remote_shell_version, display_, bind_remote_shell);
wl_global_create(wl_display_.get(), &zcr_gaming_input_v1_interface, 1,
display_, bind_gaming_input);
- wl_global_create(wl_display_.get(), &zcr_stylus_v1_interface, 1, display_,
+ wl_global_create(wl_display_.get(), &zcr_stylus_v1_interface, 2, display_,
bind_stylus);
wl_global_create(wl_display_.get(), &zcr_keyboard_configuration_v1_interface,
2, display_, bind_keyboard_configuration);
« no previous file with comments | « components/exo/pointer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698