Skip to content

Commit bcd0250

Browse files
trop[bot]zcbenzckerr
authored
fix: handle non-client area pointer events from pen on Win10 (electron#24104)
* fix: handle non client pointer events from pen on Win10 * fix trop oops * update patches Co-authored-by: Cheng Zhao <zcbenz@gmail.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
1 parent f83f776 commit bcd0250

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

patches/chromium/.patches

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,4 @@ fix_hunspell_crash.patch
125125
introduce_a_mutex_for_the_rendering_loop_in_baseaudiocontext.patch
126126
fix_default_to_ntlm_v2_in_network_service.patch
127127
fix_allow_ime_to_insert_zero-length_composition_string.patch
128+
fix_handling_non_client_pointer_events_from_pen_on_windows_10.patch
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Cheng Zhao <zcbenz@gmail.com>
3+
Date: Thu, 4 Oct 2018 14:57:02 -0700
4+
Subject: fix: handle non client pointer events from pen on Windows 10
5+
6+
Refs: https://github.com/electron/electron/issues/21440
7+
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2237535
8+
9+
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
10+
index 0e957831c25ccbb27038b9a24587621a825ec5ee..dd330f71d203f473452455f6c96d0b89074ddc1d 100644
11+
--- a/ui/views/win/hwnd_message_handler.cc
12+
+++ b/ui/views/win/hwnd_message_handler.cc
13+
@@ -2052,6 +2052,15 @@ LRESULT HWNDMessageHandler::OnPointerEvent(UINT message,
14+
return -1;
15+
}
16+
17+
+ // Pen may also send non client pointer messages, treat them as normal
18+
+ // touch events so they can be properly handled.
19+
+ if (pointer_type == PT_PEN &&
20+
+ (message == WM_NCPOINTERDOWN ||
21+
+ message == WM_NCPOINTERUP ||
22+
+ message == WM_NCPOINTERUPDATE)) {
23+
+ pointer_type = PT_TOUCH;
24+
+ }
25+
+
26+
switch (pointer_type) {
27+
case PT_PEN:
28+
return HandlePointerEventTypePen(message, w_param, l_param);

0 commit comments

Comments
 (0)