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

Unified Diff: ui/aura/root_window_host_linux.cc

Issue 8793002: aura-x11: Add support for xmodmap'ed pointer buttons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 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
Index: ui/aura/root_window_host_linux.cc
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc
index 5901e5f713c6d1c2b2e985a6534b7373ea93c3a9..a2c4a731a11e4153a0c838c901de236f53c38814 100644
--- a/ui/aura/root_window_host_linux.cc
+++ b/ui/aura/root_window_host_linux.cc
@@ -39,6 +39,7 @@ void CheckXEventForConsistency(XEvent* xevent) {
static bool expect_master_event = false;
static XIDeviceEvent slave_event;
static gfx::Point slave_location;
+ static int slave_button;
// Note: If an event comes from a slave pointer device, then it will be
// followed by the same event, but reported from its master pointer device.
@@ -62,6 +63,7 @@ void CheckXEventForConsistency(XEvent* xevent) {
if (xievent->sourceid == xievent->deviceid) {
slave_event = *xievent;
slave_location = ui::EventLocationFromNative(xevent);
+ slave_button = ui::EventButtonFromNative(xevent);
expect_master_event = true;
} else if (was_expecting_master_event) {
CHECK_EQ(slave_location.x(), ui::EventLocationFromNative(xevent).x());
@@ -69,7 +71,7 @@ void CheckXEventForConsistency(XEvent* xevent) {
CHECK_EQ(slave_event.type, xievent->type);
CHECK_EQ(slave_event.evtype, xievent->evtype);
- CHECK_EQ(slave_event.detail, xievent->detail);
+ CHECK_EQ(slave_button, ui::EventButtonFromNative(xevent));
CHECK_EQ(slave_event.flags, xievent->flags);
CHECK_EQ(slave_event.buttons.mask_len, xievent->buttons.mask_len);
CHECK_EQ(slave_event.valuators.mask_len, xievent->valuators.mask_len);
@@ -471,9 +473,18 @@ base::MessagePumpDispatcher::DispatchStatus RootWindowHostLinux::Dispatch(
break;
}
case MappingNotify: {
- if (xev->xmapping.request == MappingModifier ||
- xev->xmapping.request == MappingKeyboard)
- XRefreshKeyboardMapping(&xev->xmapping);
+ switch (xev->xmapping.request) {
+ case MappingModifier:
+ case MappingKeyboard:
+ XRefreshKeyboardMapping(&xev->xmapping);
+ break;
+ case MappingPointer:
+ ui::UpdateButtonMap();
+ break;
+ default:
+ NOTIMPLEMENTED() << " Unknown request: " << xev->xmapping.request;
+ break;
+ }
break;
}
case MotionNotify: {

Powered by Google App Engine
This is Rietveld 408576698