Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48e6d523 authored by Vania Desmonda's avatar Vania Desmonda
Browse files

Allow edge resizing using touchpad.

Test: manual test
Flag: com.android.window.flags.enable_windowing_edge_drag_resize
Fix: 358334119
Change-Id: If1518753f700c8825db88899f686ffc8661344a9
parent 0314ea4c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.wm.shell.windowdecor;

import static android.view.InputDevice.SOURCE_MOUSE;
import static android.view.InputDevice.SOURCE_TOUCHSCREEN;

import static com.android.wm.shell.shared.desktopmode.DesktopModeFlags.EDGE_DRAG_RESIZE;
@@ -166,7 +167,10 @@ final class DragResizeWindowGeometry {
    static boolean isEdgeResizePermitted(@NonNull Context context, @NonNull MotionEvent e) {
        if (EDGE_DRAG_RESIZE.isEnabled(context)) {
            return e.getToolType(0) == MotionEvent.TOOL_TYPE_STYLUS
                    || e.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE;
                    || e.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE
                    // Touchpad input
                    || (e.isFromSource(SOURCE_MOUSE)
                        && e.getToolType(0) == MotionEvent.TOOL_TYPE_FINGER);
        } else {
            return e.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE;
        }