Commit 118dd603 authored by Alexander Dunaev's avatar Alexander Dunaev Committed by Commit Bot

[ozone/wayland] Fixed TODO in WaylandWindow::SetBounds.

Implementations of PlatformWindow::SetBounds() in WaylandWindow and X11Window
are different: the latter calls delegate's OnBoundsChanged always, while the
former returns early if the new bounds were the same as the existing ones.
There is a comment in the X11 implementation that says that we need to call
delegate always because the call might be a result of the device scale factor
being changed.  We had a TODO in the Wayland implementation saying that we
need to investigate this and maybe call the delegate always as well.

The simple experiment has shown that when the device scale factor is changed,
the window gets new bounds that are not the same as the existing ones, so
the delegate is called anyway.

As a conclusion, no change is needed, and the TODO can be removed.

R=msisov@igalia.com

Bug: 958314
Change-Id: I95fcffb43d09702d3dbcc6c2083d2087e7c166f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1807823Reviewed-by: default avatarMaksim Sisov <msisov@igalia.com>
Commit-Queue: Alexander Dunaev <adunaev@igalia.com>
Cr-Commit-Position: refs/heads/master@{#697154}
parent b2c850c8
...@@ -377,15 +377,6 @@ void WaylandWindow::Close() { ...@@ -377,15 +377,6 @@ void WaylandWindow::Close() {
void WaylandWindow::PrepareForShutdown() {} void WaylandWindow::PrepareForShutdown() {}
void WaylandWindow::SetBounds(const gfx::Rect& bounds_px) { void WaylandWindow::SetBounds(const gfx::Rect& bounds_px) {
// TODO(crbug.com/958314): figure out if this return is legitimate.
//
// The X11 implementation says that even if the pixel bounds didn't change, we
// still need to forward this call to the delegate, and that the device scale
// factor may have changed which effectively changes the bounds. Perhaps we
// need to do the same here.
//
// After this is resolved, update test expectations for calls to
// delegate's OnBoundsChanged.
if (bounds_px_ == bounds_px) if (bounds_px_ == bounds_px)
return; return;
bounds_px_ = bounds_px; bounds_px_ = bounds_px;
......
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