| Index: ui/base/x/events_x.cc
|
| diff --git a/ui/base/x/events_x.cc b/ui/base/x/events_x.cc
|
| index 1a0a1467d4629aee66eb62e1beff18fa887d2e61..8dec811405639bd912aab2b309a2026e00f92663 100644
|
| --- a/ui/base/x/events_x.cc
|
| +++ b/ui/base/x/events_x.cc
|
| @@ -779,6 +779,28 @@ gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
|
| return gfx::Point();
|
| }
|
|
|
| +gfx::Point EventRootLocationFromNative(const base::NativeEvent& native_event) {
|
| + switch (native_event->type) {
|
| + case ButtonPress:
|
| + case ButtonRelease:
|
| + return gfx::Point(native_event->xbutton.x_root,
|
| + native_event->xbutton.y_root);
|
| + case MotionNotify:
|
| + return gfx::Point(native_event->xmotion.x_root,
|
| + native_event->xmotion.y_root);
|
| + case GenericEvent: {
|
| + XIDeviceEvent* xievent =
|
| + static_cast<XIDeviceEvent*>(native_event->xcookie.data);
|
| +
|
| + // TODO(erg): This is significantly more simple than the above. Does this
|
| + // not handle an important case?
|
| + return gfx::Point(xievent->root_x, xievent->root_y);
|
| + }
|
| + }
|
| +
|
| + return gfx::Point();
|
| +}
|
| +
|
| int EventButtonFromNative(const base::NativeEvent& native_event) {
|
| CHECK_EQ(GenericEvent, native_event->type);
|
| XIDeviceEvent* xievent =
|
|
|