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

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

Issue 197283008: Fix panel dragging on Linux Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index e3f1179c97597cb63622c8583613ac72b87bebb7..385a51768f7081d7daabce59155a24d8e5c97ba4 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -944,6 +944,7 @@ void DesktopWindowTreeHostX11::InitX11Window(
if (swa.override_redirect)
attribute_mask |= CWOverrideRedirect;
+ x_bounds_ = params.bounds;
bounds_ = params.bounds;
xwindow_ = XCreateWindow(
xdisplay_, x_root_window_,
@@ -1120,6 +1121,14 @@ void DesktopWindowTreeHostX11::OnCaptureReleased() {
}
void DesktopWindowTreeHostX11::DispatchMouseEvent(ui::MouseEvent* event) {
+ // The event location is relative to |x_bounds_|. However, Aura uses |bounds_|
+ // for all computations, including converting to screen coordinates. Offset
+ // the event location so that converting the event location to screen
+ // coordinates returns the correct value.
+ gfx::Vector2d event_offset(x_bounds_.origin() - bounds_.origin());
+ event->set_location(event->location() + event_offset);
+ event->set_root_location(event->location() + event_offset);
+
sadrul 2014/03/13 15:41:31 This doesn't look right. Can you update DesktopWin
pkotwicz 2014/03/13 19:47:48 I think I understand what you are asking. You are
if (!g_current_capture || g_current_capture == this) {
SendEventToProcessor(event);
} else {
@@ -1339,6 +1348,7 @@ uint32_t DesktopWindowTreeHostX11::Dispatch(const base::NativeEvent& event) {
bool size_changed = bounds_.size() != bounds.size();
bool origin_changed = bounds_.origin() != bounds.origin();
previous_bounds_ = bounds_;
+ x_bounds_ = bounds;
bounds_ = bounds;
if (size_changed)
OnHostResized(bounds.size());

Powered by Google App Engine
This is Rietveld 408576698