86 lines
3.2 KiB
Diff
86 lines
3.2 KiB
Diff
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 ||
|
|
--
|