Commit 4936cfab authored by Malay Keshav's avatar Malay Keshav Committed by Commit Bot

Repaint window when moving across displays

The paint cache used by layer paint delegates(views) do not work well
with Mirrored layers that are on different device scale factor.

This patch forces a schedule repaint when the user stops dragging the
window so that the invalid data in PaintCache is not used.

Bug: 786628
Change-Id: Ic249d592d4f93b47dc4ede4461f44a59ce7b18d7
Component: Window, Drag window, phantom window
Reviewed-on: https://chromium-review.googlesource.com/1028620Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Malay Keshav <malaykeshav@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553812}
parent 598e76c2
...@@ -23,6 +23,17 @@ ...@@ -23,6 +23,17 @@
#include "ui/wm/core/window_util.h" #include "ui/wm/core/window_util.h"
namespace ash { namespace ash {
namespace {
void RecursiveSchedulePainter(ui::Layer* layer) {
if (!layer)
return;
layer->SchedulePaint(gfx::Rect(layer->size()));
for (auto* child : layer->children())
RecursiveSchedulePainter(child);
}
} // namespace
// static // static
DragWindowResizer* DragWindowResizer::instance_ = NULL; DragWindowResizer* DragWindowResizer::instance_ = NULL;
...@@ -67,6 +78,10 @@ void DragWindowResizer::CompleteDrag() { ...@@ -67,6 +78,10 @@ void DragWindowResizer::CompleteDrag() {
GetTarget()->layer()->SetOpacity(details().initial_opacity); GetTarget()->layer()->SetOpacity(details().initial_opacity);
drag_window_controller_.reset(); drag_window_controller_.reset();
// TODO(malaykeshav) - This is temporary fix/workaround that keeps performance
// but may not give the best UI while dragging. See https://crbug/834114
RecursiveSchedulePainter(GetTarget()->layer());
// Check if the destination is another display. // Check if the destination is another display.
gfx::Point last_mouse_location_in_screen = last_mouse_location_; gfx::Point last_mouse_location_in_screen = last_mouse_location_;
::wm::ConvertPointToScreen(GetTarget()->parent(), ::wm::ConvertPointToScreen(GetTarget()->parent(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment