summaryrefslogtreecommitdiffstats
path: root/patches/chromium/0006-Build-files-necessary-for-touch-and-gestures.patch
blob: 7f9900e993b63667c84a79dcc6293342482afd0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Date: Thu, 25 Jul 2013 17:25:47 +0200
Subject: Build files necessary for touch and gestures.

Also guard the use of MessagePumpAuraX11 in events_x.cc. We need to
build it to get symbols depending on base::NativeEvent.

Change-Id: Ib7bb4fb1fc8692df1b8151c3d159de3d0f73c76f
---
 content/content_browser.gypi |  2 +-
 ui/events/event.cc           | 14 ++++++++++++--
 ui/ui.gyp                    |  2 +-
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/content/content_browser.gypi b/content/content_browser.gypi
index 99cc728..b0f963c 100644
--- a/content/content_browser.gypi
+++ b/content/content_browser.gypi
@@ -1547,7 +1547,7 @@
         ['exclude', '^browser/gamepad/gamepad_platform_data_fetcher_linux\\.cc$'],
       ],
     }],
-    ['use_aura!=1 and OS!="win"', {
+    ['use_aura!=1 and use_qt!=1 and OS!="win"', {
       'sources!': [
         'browser/renderer_host/ui_events_helper.cc',
         'browser/renderer_host/ui_events_helper.h',
diff --git a/ui/events/event.cc b/ui/events/event.cc
index 246e397..39d2b9a 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -273,7 +273,13 @@ void LocatedEvent::UpdateForRootTransform(
 MouseEvent::MouseEvent(const base::NativeEvent& native_event)
     : LocatedEvent(native_event),
       changed_button_flags_(
-          GetChangedMouseButtonFlagsFromNative(native_event)) {
+// GetChangedMouseButtonFlagsFromNative isn't implemented on Mac. MouseEvent shouldn't be used.
+#if !defined(OS_MACOSX)
+          GetChangedMouseButtonFlagsFromNative(native_event)
+#else
+          0
+#endif
+      ) {
   if (type() == ET_MOUSE_PRESSED || type() == ET_MOUSE_RELEASED)
     SetClickCount(GetRepeatCount(*this));
 }
@@ -638,6 +644,8 @@ void TranslatedKeyEvent::ConvertToKeyEvent() {
 
 ScrollEvent::ScrollEvent(const base::NativeEvent& native_event)
     : MouseEvent(native_event) {
+// GetScrollOffsets and GetFlingData aren't implemented on Mac. ScrollEvent shouldn't be used.
+#if !defined(OS_MACOSX)
   if (type() == ET_SCROLL) {
     GetScrollOffsets(native_event,
                      &x_offset_, &y_offset_,
@@ -649,7 +657,9 @@ ScrollEvent::ScrollEvent(const base::NativeEvent& native_event)
                  &x_offset_, &y_offset_,
                  &x_offset_ordinal_, &y_offset_ordinal_,
                  NULL);
-  } else {
+  } else
+#endif
+  {
     NOTREACHED() << "Unexpected event type " << type()
         << " when constructing a ScrollEvent.";
   }
diff --git a/ui/ui.gyp b/ui/ui.gyp
index 5d61dc4..aa0f3be 100644
--- a/ui/ui.gyp
+++ b/ui/ui.gyp
@@ -350,7 +350,7 @@
             ],
           },
         }],
-        ['toolkit_views==1', {
+        ['toolkit_views==1 or use_qt==1', {
           'dependencies': [
             'events/events.gyp:events',
           ],