OLD | NEW |
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/aura/root_window_host_x11.h" | 5 #include "ui/aura/root_window_host_x11.h" |
6 | 6 |
7 #include <strings.h> | 7 #include <strings.h> |
8 #include <X11/cursorfont.h> | 8 #include <X11/cursorfont.h> |
9 #include <X11/extensions/Xfixes.h> | 9 #include <X11/extensions/Xfixes.h> |
10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 XEvent* xev = event; | 935 XEvent* xev = event; |
936 if (!factory->ShouldProcessXI2Event(xev)) | 936 if (!factory->ShouldProcessXI2Event(xev)) |
937 return; | 937 return; |
938 | 938 |
939 ui::EventType type = ui::EventTypeFromNative(xev); | 939 ui::EventType type = ui::EventTypeFromNative(xev); |
940 XEvent last_event; | 940 XEvent last_event; |
941 int num_coalesced = 0; | 941 int num_coalesced = 0; |
942 | 942 |
943 switch (type) { | 943 switch (type) { |
944 case ui::ET_TOUCH_MOVED: | 944 case ui::ET_TOUCH_MOVED: |
945 num_coalesced = ui::CoalescePendingMotionEvents(xev, &last_event); | |
946 if (num_coalesced > 0) | |
947 xev = &last_event; | |
948 // fallthrough | |
949 case ui::ET_TOUCH_PRESSED: | 945 case ui::ET_TOUCH_PRESSED: |
950 case ui::ET_TOUCH_CANCELLED: | 946 case ui::ET_TOUCH_CANCELLED: |
951 case ui::ET_TOUCH_RELEASED: { | 947 case ui::ET_TOUCH_RELEASED: { |
952 ui::TouchEvent touchev(xev); | 948 ui::TouchEvent touchev(xev); |
953 #if defined(OS_CHROMEOS) | 949 #if defined(OS_CHROMEOS) |
954 if (base::chromeos::IsRunningOnChromeOS()) { | 950 if (base::chromeos::IsRunningOnChromeOS()) { |
955 if (!bounds_.Contains(touchev.location())) | 951 if (!bounds_.Contains(touchev.location())) |
956 break; | 952 break; |
957 // X maps the touch-surface to the size of the X root-window. | 953 // X maps the touch-surface to the size of the X root-window. |
958 // In multi-monitor setup, Coordinate Transformation Matrix | 954 // In multi-monitor setup, Coordinate Transformation Matrix |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 return new RootWindowHostX11(bounds); | 1089 return new RootWindowHostX11(bounds); |
1094 } | 1090 } |
1095 | 1091 |
1096 // static | 1092 // static |
1097 gfx::Size RootWindowHost::GetNativeScreenSize() { | 1093 gfx::Size RootWindowHost::GetNativeScreenSize() { |
1098 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); | 1094 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); |
1099 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 1095 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
1100 } | 1096 } |
1101 | 1097 |
1102 } // namespace aura | 1098 } // namespace aura |
OLD | NEW |