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

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

Issue 2639053002: [ozone/wayland] Implement basic keyboard handling support (Closed)
Patch Set: addressed kpschoedel's review Created 3 years, 11 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_window.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 378bf4ef2e6556856bce250e126be52387993e62..06d9c5019da917335a002d3bdf1cd2cf2bd01f88 100644
--- a/ui/ozone/platform/wayland/wayland_object.cc
+++ b/ui/ozone/platform/wayland/wayland_object.cc
@@ -10,6 +10,13 @@
namespace wl {
namespace {
+void delete_keyboard(wl_keyboard* keyboard) {
+ if (wl_keyboard_get_version(keyboard) >= WL_KEYBOARD_RELEASE_SINCE_VERSION)
+ wl_keyboard_release(keyboard);
+ else
+ wl_keyboard_destroy(keyboard);
+}
+
void delete_pointer(wl_pointer* pointer) {
if (wl_pointer_get_version(pointer) >= WL_POINTER_RELEASE_SINCE_VERSION)
wl_pointer_release(pointer);
@@ -40,6 +47,10 @@ void (*ObjectTraits<wl_display>::deleter)(wl_display*) = &wl_display_disconnect;
const wl_interface* ObjectTraits<wl_output>::interface = &wl_output_interface;
void (*ObjectTraits<wl_output>::deleter)(wl_output*) = &wl_output_destroy;
+const wl_interface* ObjectTraits<wl_keyboard>::interface =
+ &wl_keyboard_interface;
+void (*ObjectTraits<wl_keyboard>::deleter)(wl_keyboard*) = &delete_keyboard;
+
const wl_interface* ObjectTraits<wl_pointer>::interface = &wl_pointer_interface;
void (*ObjectTraits<wl_pointer>::deleter)(wl_pointer*) = &delete_pointer;
« no previous file with comments | « ui/ozone/platform/wayland/wayland_object.h ('k') | ui/ozone/platform/wayland/wayland_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698