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

Unified Diff: ui/base/x/events_x.cc

Issue 10828133: Desktop Aura: Allow tab drags out of window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 8 years, 4 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/base/win/events_win.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/events_x.cc
diff --git a/ui/base/x/events_x.cc b/ui/base/x/events_x.cc
index 1b8816a1de747829c9cbf18f4bb04470a93b4690..8c2dff28b588be303844774b7c0027ef99154da3 100644
--- a/ui/base/x/events_x.cc
+++ b/ui/base/x/events_x.cc
@@ -684,12 +684,13 @@ EventType EventTypeFromNative(const base::NativeEvent& native_event) {
bool is_cancel;
if (GetFlingData(native_event, &vx, &vy, &is_cancel)) {
return is_cancel ? ET_SCROLL_FLING_CANCEL : ET_SCROLL_FLING_START;
- } else if (GetScrollOffsets(native_event, NULL, NULL))
+ } else if (GetScrollOffsets(native_event, NULL, NULL)) {
return ET_SCROLL;
- else if (GetButtonMaskForX2Event(xievent)) {
+ } else if (GetButtonMaskForX2Event(xievent)) {
return ET_MOUSE_DRAGGED;
- } else
+ } else {
return ET_MOUSE_MOVED;
+ }
}
}
}
@@ -830,6 +831,28 @@ gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
return gfx::Point();
}
+gfx::Point EventSystemLocationFromNative(
+ 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);
+ 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 =
« no previous file with comments | « ui/base/win/events_win.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698