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

Unified Diff: ui/base/wayland/events_wayland.cc

Issue 8378005: wayland: define base:NativeEvent for Wayland (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback. Created 9 years, 1 month 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 | « base/wayland/wayland_event.h ('k') | ui/wayland/events/wayland_event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/wayland/events_wayland.cc
diff --git a/ui/base/wayland/events_wayland.cc b/ui/base/wayland/events_wayland.cc
index df6ffacc048a0972f40f54cf10ff46ca0fcd8d5c..a52a93b4c5693e7c58487d6bda6860e1e4d312fa 100644
--- a/ui/base/wayland/events_wayland.cc
+++ b/ui/base/wayland/events_wayland.cc
@@ -4,13 +4,31 @@
#include "ui/base/events.h"
+#include <linux/input.h>
#include <X11/extensions/XInput2.h>
+#include "base/event_types.h"
#include "base/logging.h"
#include "ui/base/keycodes/keyboard_code_conversion_x.h"
-#include "ui/wayland/events/wayland_event.h"
#include "ui/gfx/point.h"
+using namespace base::wayland;
+
+namespace ui {
+
+// These are the mouse events expected. The event type Wayland sends is an
+// evdev event. The following is the correct mapping from evdev to expected
+// events type.
+enum WaylandEventButtonType {
+ LEFT_BUTTON = BTN_LEFT,
+ MIDDLE_BUTTON = BTN_RIGHT,
+ RIGHT_BUTTON = BTN_MIDDLE,
+ SCROLL_UP = BTN_SIDE,
+ SCROLL_DOWN = BTN_EXTRA,
+};
+
+} // namespace ui
+
namespace {
// Scroll amount for each wheelscroll event. 53 is also the value used for GTK+.
@@ -126,7 +144,7 @@ bool IsMouseEvent(const base::NativeEvent& native_event) {
}
int GetMouseWheelOffset(const base::NativeEvent& native_event) {
- return native_event->button.button == ui::SCROLL_UP ?
+ return native_event->button.button == SCROLL_UP ?
kWheelScrollAmount : -kWheelScrollAmount;
}
« no previous file with comments | « base/wayland/wayland_event.h ('k') | ui/wayland/events/wayland_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698