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

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

Issue 1410873012: events: Preserve pointer details in native MouseEvent constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « ui/events/win/events_win.cc ('k') | no next file » | 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 <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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 default: 668 default:
669 break; 669 break;
670 } 670 }
671 } 671 }
672 default: 672 default:
673 break; 673 break;
674 } 674 }
675 return 0; 675 return 0;
676 } 676 }
677 677
678 PointerDetails GetMousePointerDetailsFromNative(
679 const base::NativeEvent& native_event) {
680 return PointerDetails(EventPointerType::POINTER_TYPE_MOUSE);
681 }
682
sadrul 2015/11/10 16:24:43 I really quite dislike adding more of these ... bu
678 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) { 683 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) {
679 float x_offset, y_offset; 684 float x_offset, y_offset;
680 if (GetScrollOffsets( 685 if (GetScrollOffsets(
681 native_event, &x_offset, &y_offset, NULL, NULL, NULL)) { 686 native_event, &x_offset, &y_offset, NULL, NULL, NULL)) {
682 return gfx::Vector2d(static_cast<int>(x_offset), 687 return gfx::Vector2d(static_cast<int>(x_offset),
683 static_cast<int>(y_offset)); 688 static_cast<int>(y_offset));
684 } 689 }
685 690
686 int button = native_event->type == GenericEvent ? 691 int button = native_event->type == GenericEvent ?
687 EventButtonFromNative(native_event) : native_event->xbutton.button; 692 EventButtonFromNative(native_event) : native_event->xbutton.button;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 xievent->detail = 880 xievent->detail =
876 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); 881 UpdateX11EventButton(event->changed_button_flags(), xievent->detail);
877 break; 882 break;
878 } 883 }
879 default: 884 default:
880 break; 885 break;
881 } 886 }
882 } 887 }
883 888
884 } // namespace ui 889 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/win/events_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698