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

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

Issue 187333004: Fix direction of horizontal scroll when tilting the scroll wheel on Linux Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/events/x/events_x_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <cmath> 7 #include <cmath>
8 #include <string.h> 8 #include <string.h>
9 #include <X11/extensions/XInput.h> 9 #include <X11/extensions/XInput.h>
10 #include <X11/extensions/XInput2.h> 10 #include <X11/extensions/XInput2.h>
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 519
520 int button = native_event->type == GenericEvent ? 520 int button = native_event->type == GenericEvent ?
521 EventButtonFromNative(native_event) : native_event->xbutton.button; 521 EventButtonFromNative(native_event) : native_event->xbutton.button;
522 522
523 switch (button) { 523 switch (button) {
524 case 4: 524 case 4:
525 return gfx::Vector2d(0, kWheelScrollAmount); 525 return gfx::Vector2d(0, kWheelScrollAmount);
526 case 5: 526 case 5:
527 return gfx::Vector2d(0, -kWheelScrollAmount); 527 return gfx::Vector2d(0, -kWheelScrollAmount);
528 case 6: 528 case 6:
529 return gfx::Vector2d(kWheelScrollAmount, 0);
530 case 7:
529 return gfx::Vector2d(-kWheelScrollAmount, 0); 531 return gfx::Vector2d(-kWheelScrollAmount, 0);
530 case 7:
531 return gfx::Vector2d(kWheelScrollAmount, 0);
532 default: 532 default:
533 return gfx::Vector2d(); 533 return gfx::Vector2d();
534 } 534 }
535 } 535 }
536 536
537 void ClearTouchIdIfReleased(const base::NativeEvent& xev) { 537 void ClearTouchIdIfReleased(const base::NativeEvent& xev) {
538 ui::EventType type = ui::EventTypeFromNative(xev); 538 ui::EventType type = ui::EventTypeFromNative(xev);
539 if (type == ui::ET_TOUCH_CANCELLED || 539 if (type == ui::ET_TOUCH_CANCELLED ||
540 type == ui::ET_TOUCH_RELEASED) { 540 type == ui::ET_TOUCH_RELEASED) {
541 ui::TouchFactory* factory = ui::TouchFactory::GetInstance(); 541 ui::TouchFactory* factory = ui::TouchFactory::GetInstance();
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 673
674 bool IsNaturalScrollEnabled() { 674 bool IsNaturalScrollEnabled() {
675 return DeviceDataManager::GetInstance()->natural_scroll_enabled(); 675 return DeviceDataManager::GetInstance()->natural_scroll_enabled();
676 } 676 }
677 677
678 bool IsTouchpadEvent(const base::NativeEvent& event) { 678 bool IsTouchpadEvent(const base::NativeEvent& event) {
679 return DeviceDataManager::GetInstance()->IsTouchpadXInputEvent(event); 679 return DeviceDataManager::GetInstance()->IsTouchpadXInputEvent(event);
680 } 680 }
681 681
682 } // namespace ui 682 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/events/x/events_x_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698