diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 15:41:38 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 15:41:38 +0000 |
commit | b0055b9c2fb9713631930dfa95d1112b0c7ec590 (patch) | |
tree | c7dc841a7910376ce2702be56719c069c5e5061d /ui/base | |
parent | 5f19571f496e421ff45352fc8ec4a157bf8f631a (diff) | |
download | chromium_src-b0055b9c2fb9713631930dfa95d1112b0c7ec590.zip chromium_src-b0055b9c2fb9713631930dfa95d1112b0c7ec590.tar.gz chromium_src-b0055b9c2fb9713631930dfa95d1112b0c7ec590.tar.bz2 |
aura: Preprocess an XEvent to make changes for 'alt-click to right-click' before dispatching begins.
This fixes a crash that happens from converting an alt-click to right-click.
BUG=126529
TEST=manually
Review URL: https://chromiumcodereview.appspot.com/10377071
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136311 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base')
-rw-r--r-- | ui/base/x/events_x.cc | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/ui/base/x/events_x.cc b/ui/base/x/events_x.cc index 1beb58f..6c57af0 100644 --- a/ui/base/x/events_x.cc +++ b/ui/base/x/events_x.cc @@ -409,23 +409,6 @@ int GetEventFlagsForButton(int button) { } } -void DetectAltClick(XIDeviceEvent* xievent) { - if ((xievent->evtype == XI_ButtonPress || - xievent->evtype == XI_ButtonRelease) && - (xievent->mods.effective & Mod1Mask) && - xievent->detail == 1) { - xievent->mods.effective &= ~Mod1Mask; - xievent->detail = 3; - if (xievent->evtype == XI_ButtonRelease) { - // On the release clear the left button from the existing state and the - // mods, and set the right button. - XISetMask(xievent->buttons.mask, 3); - XIClearMask(xievent->buttons.mask, 1); - xievent->mods.effective &= ~Button1Mask; - } - } -} - int GetButtonMaskForX2Event(XIDeviceEvent* xievent) { int buttonflags = 0; for (int i = 0; i < 8 * xievent->buttons.mask_len; i++) { @@ -616,9 +599,6 @@ EventType EventTypeFromNative(const base::NativeEvent& native_event) { XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(native_event->xcookie.data); - // Map Alt+Button1 to Button3 - DetectAltClick(xievent); - if (factory->IsTouchDevice(xievent->sourceid)) return GetTouchEventType(native_event); @@ -677,9 +657,6 @@ int EventFlagsFromNative(const base::NativeEvent& native_event) { XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(native_event->xcookie.data); - // Map Alt+Button1 to Button3. - DetectAltClick(xievent); - const bool touch = TouchFactory::GetInstance()->IsTouchDevice(xievent->sourceid); switch (xievent->evtype) { |