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

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

Issue 10830293: Fixes bug where Env/RootWindow would cache the wrong button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to trunk 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') | no next file » | 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 bb36d921cdef6191f298a10b56b7aa74f02e302a..fa55e5da619f58dfb501108934c8219678641658 100644
--- a/ui/base/x/events_x.cc
+++ b/ui/base/x/events_x.cc
@@ -863,6 +863,29 @@ bool IsMouseEvent(const base::NativeEvent& native_event) {
return false;
}
+int GetChangedMouseButtonFlagsFromNative(
+ const base::NativeEvent& native_event) {
+ switch (native_event->type) {
+ case ButtonPress:
+ case ButtonRelease:
+ return GetEventFlagsFromXState(native_event->xbutton.state);
+ case GenericEvent: {
+ XIDeviceEvent* xievent =
+ static_cast<XIDeviceEvent*>(native_event->xcookie.data);
+ switch (xievent->evtype) {
+ case XI_ButtonPress:
+ case XI_ButtonRelease:
+ return GetEventFlagsForButton(EventButtonFromNative(native_event));
+ default:
+ break;
+ }
+ }
+ default:
+ break;
+ }
+ return 0;
+}
+
int GetMouseWheelOffset(const base::NativeEvent& native_event) {
int button = native_event->type == GenericEvent
? EventButtonFromNative(native_event) : native_event->xbutton.button;
« no previous file with comments | « ui/base/win/events_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698