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

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

Issue 11024010: Use correct location for Enter/LeaveNotify (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adressed comments Created 8 years, 2 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 | « no previous file | ui/base/x/events_x_unittest.cc » ('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 a8b44f55ea3129a071406fb3e9ed765ca1d97719..8245964e7c84bdef06f9b98aa39d174b6477643e 100644
--- a/ui/base/x/events_x.cc
+++ b/ui/base/x/events_x.cc
@@ -818,6 +818,9 @@ base::TimeDelta EventTimeFromNative(const base::NativeEvent& native_event) {
gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
switch (native_event->type) {
+ case EnterNotify:
+ case LeaveNotify:
+ return gfx::Point(native_event->xcrossing.x, native_event->xcrossing.y);
case ButtonPress:
case ButtonRelease:
return gfx::Point(native_event->xbutton.x, native_event->xbutton.y);
@@ -863,6 +866,11 @@ gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
gfx::Point EventSystemLocationFromNative(
const base::NativeEvent& native_event) {
switch (native_event->type) {
+ case EnterNotify:
+ case LeaveNotify: {
+ return gfx::Point(native_event->xcrossing.x_root,
+ native_event->xcrossing.y_root);
+ }
case ButtonPress:
case ButtonRelease: {
return gfx::Point(native_event->xbutton.x_root,
@@ -897,7 +905,9 @@ KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) {
}
bool IsMouseEvent(const base::NativeEvent& native_event) {
- if (native_event->type == ButtonPress ||
+ if (native_event->type == EnterNotify ||
+ native_event->type == LeaveNotify ||
+ native_event->type == ButtonPress ||
native_event->type == ButtonRelease ||
native_event->type == MotionNotify)
return true;
« no previous file with comments | « no previous file | ui/base/x/events_x_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698