forked from bromite/bromite
-
Notifications
You must be signed in to change notification settings - Fork 249
Expand file tree
/
Copy pathDisable-support-for-pointer-device-id.patch
More file actions
85 lines (79 loc) · 3.24 KB
/
Disable-support-for-pointer-device-id.patch
File metadata and controls
85 lines (79 loc) · 3.24 KB
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
81
82
83
84
85
From: uazo <uazo@users.noreply.github.com>
Date: Thu, 25 Jul 2024 08:25:37 +0000
Subject: Disable support for pointer device id
disable pointerEvent.deviceId for Windows devices that are able to provide a GUID
or serial number and id making them identical to the mouse pointer-id.
see https://groups.google.com/a/chromium.org/g/blink-dev/c/3eU-AHH8x4k
Need: Add-cromite-flags-support.patch
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
.../Disable_pointer_deviceid_support.inc | 12 ++++++++++++
.../features_cc/Disable_pointer_deviceid_support.inc | 8 ++++++++
.../features_h/Disable_pointer_deviceid_support.inc | 7 +++++++
ui/views/win/pen_id_handler.cc | 5 +++++
4 files changed, 32 insertions(+)
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Disable_pointer_deviceid_support.inc
create mode 100644 cromite_flags/ui/base/features_cc/Disable_pointer_deviceid_support.inc
create mode 100644 cromite_flags/ui/base/features_h/Disable_pointer_deviceid_support.inc
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Disable_pointer_deviceid_support.inc b/cromite_flags/chrome/browser/about_flags_cc/Disable_pointer_deviceid_support.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/chrome/browser/about_flags_cc/Disable_pointer_deviceid_support.inc
@@ -0,0 +1,12 @@
+#ifdef FLAG_SECTION
+
+#if BUILDFLAG(IS_WIN)
+
+ {"enable-pointer-event-deviceid",
+ "Enable Pointer Event DeviceId",
+ "Allows the use of the device id for Multi-Pen Inking", kOsWin,
+ FEATURE_VALUE_TYPE(features::kEnablePointerEventDeviceId)},
+
+#endif // BUILDFLAG(IS_WIN)
+
+#endif // ifdef FLAG_SECTION
diff --git a/cromite_flags/ui/base/features_cc/Disable_pointer_deviceid_support.inc b/cromite_flags/ui/base/features_cc/Disable_pointer_deviceid_support.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/ui/base/features_cc/Disable_pointer_deviceid_support.inc
@@ -0,0 +1,8 @@
+
+#if BUILDFLAG(IS_WIN)
+
+CROMITE_FEATURE(kEnablePointerEventDeviceId,
+ "EnablePointerEventDeviceId",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
+#endif
diff --git a/cromite_flags/ui/base/features_h/Disable_pointer_deviceid_support.inc b/cromite_flags/ui/base/features_h/Disable_pointer_deviceid_support.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/ui/base/features_h/Disable_pointer_deviceid_support.inc
@@ -0,0 +1,7 @@
+
+#if BUILDFLAG(IS_WIN)
+
+COMPONENT_EXPORT(UI_BASE_FEATURES)
+BASE_DECLARE_FEATURE(kEnablePointerEventDeviceId);
+
+#endif
diff --git a/ui/views/win/pen_id_handler.cc b/ui/views/win/pen_id_handler.cc
--- a/ui/views/win/pen_id_handler.cc
+++ b/ui/views/win/pen_id_handler.cc
@@ -4,6 +4,7 @@
#include "ui/views/win/pen_id_handler.h"
+#include "ui/base/ui_base_features.h"
#include "base/no_destructor.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
@@ -57,6 +58,10 @@ class PenIdStatics {
};
bool PenDeviceApiSupported() {
+ if (!base::FeatureList::IsEnabled(
+ features::kEnablePointerEventDeviceId)) {
+ return false;
+ }
// PenDevice API only works properly on WIN11 or Win10 post v19044.
return base::win::OSInfo::Kernel32Version() >
base::win::Version::WIN10_21H2 ||
--