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

Unified Diff: ui/ozone/platform/wayland/wayland_connection.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_connection.h ('k') | ui/ozone/platform/wayland/wayland_keyboard.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 520b21f9f08a62f6b17332484c7e0d6a58a115db..6db7a8f67910b2cb4c3565208a6684452b63181f 100644
--- a/ui/ozone/platform/wayland/wayland_connection.cc
+++ b/ui/ozone/platform/wayland/wayland_connection.cc
@@ -227,6 +227,20 @@ void WaylandConnection::Capabilities(void* data,
} else if (connection->pointer_) {
connection->pointer_.reset();
}
+ if (capabilities & WL_SEAT_CAPABILITY_KEYBOARD) {
+ if (!connection->keyboard_) {
+ wl_keyboard* keyboard = wl_seat_get_keyboard(connection->seat_.get());
+ if (!keyboard) {
+ LOG(ERROR) << "Failed to get wl_keyboard from seat";
+ return;
+ }
+ connection->keyboard_ = base::MakeUnique<WaylandKeyboard>(
+ keyboard, base::Bind(&WaylandConnection::DispatchUiEvent,
+ base::Unretained(connection)));
+ }
+ } else if (connection->keyboard_) {
+ connection->keyboard_.reset();
+ }
connection->ScheduleFlush();
}
« no previous file with comments | « ui/ozone/platform/wayland/wayland_connection.h ('k') | ui/ozone/platform/wayland/wayland_keyboard.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698