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

Unified Diff: ui/ozone/platform/wayland/wayland_object.cc

Issue 1712103002: ozone/platform/wayland: Implement pointer handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 months 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 | « ui/ozone/platform/wayland/wayland_object.h ('k') | ui/ozone/platform/wayland/wayland_pointer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/wayland/wayland_object.cc
diff --git a/ui/ozone/platform/wayland/wayland_object.cc b/ui/ozone/platform/wayland/wayland_object.cc
index 27a409550bc6d5924d7bd94df8ebb64e0c9ab6d7..6b7f1e185aef572b7fd4fe9b247a8f1e545daa05 100644
--- a/ui/ozone/platform/wayland/wayland_object.cc
+++ b/ui/ozone/platform/wayland/wayland_object.cc
@@ -8,6 +8,23 @@
#include <xdg-shell-unstable-v5-client-protocol.h>
namespace wl {
+namespace {
+
+void delete_pointer(wl_pointer* pointer) {
+ if (wl_pointer_get_version(pointer) >= WL_POINTER_RELEASE_SINCE_VERSION)
+ wl_pointer_release(pointer);
+ else
+ wl_pointer_destroy(pointer);
+}
+
+void delete_seat(wl_seat* seat) {
+ if (wl_seat_get_version(seat) >= WL_SEAT_RELEASE_SINCE_VERSION)
+ wl_seat_release(seat);
+ else
+ wl_seat_destroy(seat);
+}
+
+} // namespace
const wl_interface* ObjectTraits<wl_buffer>::interface = &wl_buffer_interface;
void (*ObjectTraits<wl_buffer>::deleter)(wl_buffer*) = &wl_buffer_destroy;
@@ -20,10 +37,16 @@ void (*ObjectTraits<wl_compositor>::deleter)(wl_compositor*) =
const wl_interface* ObjectTraits<wl_display>::interface = &wl_display_interface;
void (*ObjectTraits<wl_display>::deleter)(wl_display*) = &wl_display_disconnect;
+const wl_interface* ObjectTraits<wl_pointer>::interface = &wl_pointer_interface;
+void (*ObjectTraits<wl_pointer>::deleter)(wl_pointer*) = &delete_pointer;
+
const wl_interface* ObjectTraits<wl_registry>::interface =
&wl_registry_interface;
void (*ObjectTraits<wl_registry>::deleter)(wl_registry*) = &wl_registry_destroy;
+const wl_interface* ObjectTraits<wl_seat>::interface = &wl_seat_interface;
+void (*ObjectTraits<wl_seat>::deleter)(wl_seat*) = &delete_seat;
+
const wl_interface* ObjectTraits<wl_shm>::interface = &wl_shm_interface;
void (*ObjectTraits<wl_shm>::deleter)(wl_shm*) = &wl_shm_destroy;
« no previous file with comments | « ui/ozone/platform/wayland/wayland_object.h ('k') | ui/ozone/platform/wayland/wayland_pointer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698