Use spy windows to resize tasks
This CL does a few things to achieve the goal: 1. It converts the input windows of decor container layers to spy windows, so that input windows behind them can receive input events at the same time. This is what allows the close button in the caption to receive mouse clicks even if the mouse clicks in the intersected area of the close button and the square top-right touch resize handle. 2. It adds task input sinks behind decor container layers, so that motion events received by resize handlers out of task windows won't be dispatched to windows behind the resize handlers. I chose to put the task input sinks under the decor container layers so that the logic can be mostly limited inside DragResizeInputListener. 3. Resize handlers pilfer events when they decide to handle resize gestures. Windows that received the same gesture will receive a cancelled event. There are a few remaining issues: 1. We update mouse cursors whenever the resize handlers receive hover events. We should avoid updating them when they aren't supposed to to resize task windows if the resize is started at the hover events, so windows behind the resize handlers have chances to update the mouse cursor shape. 2. The mouse cursor shape are updated to double arrows if the mouse hovers in corner areas that are slightly over task radii inward to one side of the task bounds, and less than corner sizes inward to an adjacent side of the task bounds. However this place is completely inside the task bounds, so we shouldn't resize the task at all with mice. This CL also changes the CtrlType annotation to be flags. Bug: 266866903 Test: Close buttons in captions be clicked when the mouse cursor is close to the corner. Change-Id: I28215f1dc51bfaaccfd5fa4856186f4a6f0e4925
Loading
Please register or sign in to comment