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

Unified Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc

Issue 2228093003: Fix wrong popup offset when changing popup bounds. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
index b19ee7f72780eb9ea16faf01cb956c4538ba34b6..5cdf5ed10fef85b47caed95d6db57b4d33c3f7ea 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -150,8 +150,14 @@ class DesktopNativeWidgetTopLevelHandler : public aura::WindowObserver {
// The position of the window may have changed. Hence we use SetBounds in
// place of SetSize. We need to pass the bounds in screen coordinates to
// the Widget::SetBounds function.
- if (top_level_widget_ && window == child_window_)
+ if (top_level_widget_ && window == child_window_) {
top_level_widget_->SetBounds(window->GetBoundsInScreen());
ananta 2016/08/09 21:24:07 The Widget::SetBounds should make it all the way t
bokan 2016/08/11 17:04:08 The aura::Window *is* resized, the problem is that
bokan 2016/08/11 18:14:24 Stepping through on Win, we do get through to HWND
+
+ // The window's position is relative to the widget. If the widget
+ // position changed from the call above then it'll be "double applied".
+ // We clear the origin here to allow the widget to position the window.
+ window->SetBounds(gfx::Rect(gfx::Point(), window->bounds().size()));
sky 2016/08/15 15:05:48 I'm nervous about changing the bounds of the same
bokan 2016/08/18 22:51:06 Thanks, I'll give that a try. Any advice on where
bokan 2016/08/19 17:57:46 I don't think this'll work since the flow through
+ }
}
private:
« 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