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

Unified Diff: components/exo/display.cc

Issue 2467173002: exo: Fix widget positioning for pop-ups (Closed)
Patch Set: Add unit test Created 4 years, 1 month 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 | components/exo/shell_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/display.cc
diff --git a/components/exo/display.cc b/components/exo/display.cc
index 02b6d0ea11047a8ab8ac3f1645bedbeee1358965..af2a2ad9f67f83e7e2a9bc233dda5a851059f753 100644
--- a/components/exo/display.cc
+++ b/components/exo/display.cc
@@ -19,6 +19,7 @@
#include "components/exo/sub_surface.h"
#include "components/exo/surface.h"
#include "ui/views/widget/widget.h"
+#include "ui/wm/core/coordinate_conversion.h"
#if defined(USE_OZONE)
#include <GLES2/gl2extchromium.h>
@@ -135,13 +136,13 @@ std::unique_ptr<ShellSurface> Display::CreatePopupShellSurface(
}
// Determine the initial bounds for popup. |position| is relative to the
- // parent's main surface origin and initial bounds are relative to the
- // container origin.
- gfx::Rect initial_bounds(position, gfx::Size(1, 1));
- aura::Window::ConvertRectToTarget(
+ // parent's main surface origin and initial bounds are in screen coordinates.
+ gfx::Point origin = position;
+ wm::ConvertPointToScreen(
ShellSurface::GetMainSurface(parent->GetWidget()->GetNativeWindow())
->window(),
- parent->GetWidget()->GetNativeWindow()->parent(), &initial_bounds);
+ &origin);
+ gfx::Rect initial_bounds(origin, gfx::Size(1, 1));
return base::MakeUnique<ShellSurface>(surface, parent, initial_bounds,
false /* activatable */,
« no previous file with comments | « no previous file | components/exo/shell_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698