Merge pull request #95155 from bruvzg/win_pen_checks

[Windows] Reject `WM_POINTER(UP/DOWN)` messages for non pen pointer type.
This commit is contained in:
Rémi Verschelde 2024-08-06 12:32:02 +02:00
commit e693ff814a
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 10 additions and 0 deletions

View File

@ -4253,6 +4253,16 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
break;
}
uint32_t pointer_id = LOWORD(wParam);
POINTER_INPUT_TYPE pointer_type = PT_POINTER;
if (!win8p_GetPointerType(pointer_id, &pointer_type)) {
break;
}
if (pointer_type != PT_PEN) {
break;
}
Ref<InputEventMouseButton> mb;
mb.instantiate();
mb->set_window_id(window_id);