Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8313)

Unified Diff: components/exo/shell_surface.cc

Issue 2176293002: exo: Convert widget bounds to screen coordinates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 06c277d2b644693846f47f9f7e80cee1a638d89e..94b926db05c10437d8567a77e577d0e8188a5777 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -29,6 +29,7 @@
#include "ui/gfx/path.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_observer.h"
+#include "ui/wm/core/coordinate_conversion.h"
#include "ui/wm/core/shadow.h"
#include "ui/wm/core/shadow_controller.h"
#include "ui/wm/core/shadow_types.h"
@@ -1147,10 +1148,10 @@ void ShellSurface::UpdateWidgetBounds() {
gfx::Rect visible_bounds = GetVisibleBounds();
gfx::Rect new_widget_bounds = visible_bounds;
- // Avoid changing widget origin unless initial bounds were specificed and
+ // Avoid changing widget origin unless initial bounds were specified and
// widget origin is always relative to it.
if (initial_bounds_.IsEmpty())
- new_widget_bounds.set_origin(widget_->GetNativeWindow()->bounds().origin());
+ new_widget_bounds.set_origin(widget_->GetWindowBoundsInScreen().origin());
// Update widget origin using the surface origin if the current location of
// surface is being anchored to one side of the widget as a result of a
@@ -1158,9 +1159,7 @@ void ShellSurface::UpdateWidgetBounds() {
if (resize_component_ != HTCAPTION) {
gfx::Point new_widget_origin =
GetSurfaceOrigin() + visible_bounds.OffsetFromOrigin();
- aura::Window::ConvertPointToTarget(widget_->GetNativeWindow(),
- widget_->GetNativeWindow()->parent(),
- &new_widget_origin);
+ wm::ConvertPointToScreen(widget_->GetNativeWindow(), &new_widget_origin);
new_widget_bounds.set_origin(new_widget_origin);
}
@@ -1168,7 +1167,7 @@ void ShellSurface::UpdateWidgetBounds() {
// should not result in a configure request.
DCHECK(!ignore_window_bounds_changes_);
ignore_window_bounds_changes_ = true;
- if (widget_->GetNativeWindow()->bounds() != new_widget_bounds)
+ if (widget_->GetWindowBoundsInScreen() != new_widget_bounds)
widget_->SetBounds(new_widget_bounds);
ignore_window_bounds_changes_ = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698