Add NO_FOCUS_CHANGE flag to pointer gestures to disallow focus changes
When using a multi-touch trackpad, it is the expected behavior in most operating systems that the user is allowed to perform gestures (like scroll, pinch, etc.) on an unfocused window without bringing it into focus. The previous behavior in Android was that any DOWN event on an unfocused window would bring the unfocused window into focus, including any pointer gesture. This change adds the NO_FOCUS_CHANGE flag to the MotionEvents generated by certain pointer gestures so that it does not change window focus. Gestures such as tap and tap drag are not affected. Bug: 173733166 Test: atest inputflinger_tests Test: manual: in multi-display scenario with freeform windows and a trackpad: open two freeform windows so that they overlap, perform gesture (scroll/pinch) on unfocused window, observe that the window is not focused; perform tap on unfocused window, observe that the window is focused. Change-Id: I74e52f8daa13d4e6c047bc23982ec56942c555f6
Loading
Please register or sign in to comment