vk: Only send visibility / bounds changes if there are real changes.
Whenever the VK visibility / bounds changes, it notifies listeners such as the WorkspaceLayoutManager. For historical reasons, we always notify the first time, even if there was actually no change. For example, the VK starts off with empty "displaced" bounds. If the VK is opened, the "displaced" bounds can still be empty (as expected). However, we still notify listeners that the bounds have "changed" to empty, even though it was already empty. This can be misleading. It makes more sense to only notify when there is actually a change in the bounds value. In fact, [1] relies on this behaviour. Whenever it receives a zero bounds, it assumes that the VK went from shown -> hidden. The assumption only holds if we always send real bounds changes. [1] https://source.chromium.org/chromium/chromium/src/+/master:ash/wm/workspace/workspace_layout_manager.cc;l=249;drc=e3687581e4b1a85562130e9cc1a8765fc5b9022e Bug: 1030481 Change-Id: I0cdd91e2b334caefd3f10b818d3d4b6b77a2ee93 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2434410Reviewed-by:Yuichiro Hanada <yhanada@chromium.org> Reviewed-by:
James Cook <jamescook@chromium.org> Commit-Queue: James Cook <jamescook@chromium.org> Auto-Submit: Darren Shen <shend@chromium.org> Cr-Commit-Position: refs/heads/master@{#812235}
Showing
Please register or sign in to comment