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

Side by Side Diff: ui/events/x/events_x.cc

Issue 1147293002: Stop dispatching mouse move events for wheel scrolling in X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch to CHECK. Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/event_constants.h" 5 #include "ui/events/event_constants.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <X11/extensions/XInput.h> 8 #include <X11/extensions/XInput.h>
9 #include <X11/extensions/XInput2.h> 9 #include <X11/extensions/XInput2.h>
10 #include <X11/XKBlib.h> 10 #include <X11/XKBlib.h>
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 if (GetFlingData(native_event, NULL, NULL, NULL, NULL, &is_cancel)) 435 if (GetFlingData(native_event, NULL, NULL, NULL, NULL, &is_cancel))
436 return is_cancel ? ET_SCROLL_FLING_CANCEL : ET_SCROLL_FLING_START; 436 return is_cancel ? ET_SCROLL_FLING_CANCEL : ET_SCROLL_FLING_START;
437 if (devices->IsScrollEvent(native_event)) { 437 if (devices->IsScrollEvent(native_event)) {
438 return devices->IsTouchpadXInputEvent(native_event) ? ET_SCROLL 438 return devices->IsTouchpadXInputEvent(native_event) ? ET_SCROLL
439 : ET_MOUSEWHEEL; 439 : ET_MOUSEWHEEL;
440 } 440 }
441 if (devices->IsCMTMetricsEvent(native_event)) 441 if (devices->IsCMTMetricsEvent(native_event))
442 return ET_UMA_DATA; 442 return ET_UMA_DATA;
443 if (GetButtonMaskForX2Event(xievent)) 443 if (GetButtonMaskForX2Event(xievent))
444 return ET_MOUSE_DRAGGED; 444 return ET_MOUSE_DRAGGED;
445
446 XIDeviceEvent* xievent =
447 static_cast<XIDeviceEvent*>(native_event->xcookie.data);
448
sadrul 2015/05/26 17:52:51 |xievent| is already defined (line 403). So this i
tdresser 2015/05/27 12:49:39 Thanks. Done.
449 if (DeviceDataManagerX11::GetInstance()->HasEventData(
450 xievent, DeviceDataManagerX11::DT_CMT_SCROLL_X) ||
451 DeviceDataManagerX11::GetInstance()->HasEventData(
452 xievent, DeviceDataManagerX11::DT_CMT_SCROLL_Y)) {
453 // Don't produce mouse move events for mousewheel scrolls.
454 return ET_UNKNOWN;
455 }
456
445 return ET_MOUSE_MOVED; 457 return ET_MOUSE_MOVED;
446 } 458 }
447 case XI_KeyPress: 459 case XI_KeyPress:
448 return ET_KEY_PRESSED; 460 return ET_KEY_PRESSED;
449 case XI_KeyRelease: 461 case XI_KeyRelease:
450 return ET_KEY_RELEASED; 462 return ET_KEY_RELEASED;
451 } 463 }
452 } 464 }
453 default: 465 default:
454 break; 466 break;
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 xievent->detail = 912 xievent->detail =
901 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); 913 UpdateX11EventButton(event->changed_button_flags(), xievent->detail);
902 break; 914 break;
903 } 915 }
904 default: 916 default:
905 break; 917 break;
906 } 918 }
907 } 919 }
908 920
909 } // namespace ui 921 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698