summaryrefslogtreecommitdiff
path: root/chromium/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-08-08 14:30:41 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-08-12 13:49:54 +0200
commitab0a50979b9eb4dfa3320eff7e187e41efedf7a9 (patch)
tree498dfb8a97ff3361a9f7486863a52bb4e26bb898 /chromium/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc
parent4ce69f7403811819800e7c5ae1318b2647e778d1 (diff)
downloadqtwebengine-chromium-ab0a50979b9eb4dfa3320eff7e187e41efedf7a9.tar.gz
Update Chromium to beta version 37.0.2062.68
Change-Id: I188e3b5aff1bec75566014291b654eb19f5bc8ca Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'chromium/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc')
-rw-r--r--chromium/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc53
1 files changed, 7 insertions, 46 deletions
diff --git a/chromium/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc b/chromium/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc
index a79d365ebc7..195d102a587 100644
--- a/chromium/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc
+++ b/chromium/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc
@@ -5,45 +5,22 @@
#include "ui/views/widget/desktop_aura/x11_desktop_window_move_client.h"
#include <X11/Xlib.h>
-// Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class.
-#undef RootWindow
#include "base/debug/stack_trace.h"
#include "base/message_loop/message_loop.h"
-#include "base/message_loop/message_pump_x11.h"
#include "base/run_loop.h"
#include "ui/aura/env.h"
-#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
+#include "ui/aura/window_tree_host.h"
#include "ui/base/x/x11_util.h"
#include "ui/events/event.h"
#include "ui/gfx/screen.h"
-namespace {
-
-// Delay moving the window.
-//
-// When we receive a mouse move event, we have to have it processed in a
-// different run through the message pump because moving the window will
-// otherwise prevent tasks from running.
-//
-// This constant was derived with playing with builds of chrome; it has no
-// theoretical justification.
-//
-// TODO(erg): This helps with the performance of dragging windows, but it
-// doesn't really solve the hard problems, which is that various calls to X11,
-// such as XQueryPointer, ui::IsWindowVisible() and ui::WindowContainsPoint()
-// take a while to get replies and block in the process. I've seen all of the
-// above take as long as 20ms to respond.
-const int kMoveDelay = 3;
-
-} // namespace
-
namespace views {
X11DesktopWindowMoveClient::X11DesktopWindowMoveClient()
: move_loop_(this),
- root_window_(NULL) {
+ host_(NULL) {
}
X11DesktopWindowMoveClient::~X11DesktopWindowMoveClient() {}
@@ -51,15 +28,7 @@ X11DesktopWindowMoveClient::~X11DesktopWindowMoveClient() {}
void X11DesktopWindowMoveClient::OnMouseMovement(XMotionEvent* event) {
gfx::Point cursor_point(event->x_root, event->y_root);
gfx::Point system_loc = cursor_point - window_offset_;
-
- gfx::Rect target_rect(system_loc, root_window_->host()->GetBounds().size());
-
- window_move_timer_.Start(
- FROM_HERE,
- base::TimeDelta::FromMilliseconds(kMoveDelay),
- base::Bind(&X11DesktopWindowMoveClient::SetHostBounds,
- base::Unretained(this),
- target_rect));
+ host_->SetBounds(gfx::Rect(system_loc, host_->GetBounds().size()));
}
void X11DesktopWindowMoveClient::OnMouseReleased() {
@@ -67,33 +36,25 @@ void X11DesktopWindowMoveClient::OnMouseReleased() {
}
void X11DesktopWindowMoveClient::OnMoveLoopEnded() {
- root_window_ = NULL;
+ host_ = NULL;
}
////////////////////////////////////////////////////////////////////////////////
-// DesktopRootWindowHostLinux, aura::client::WindowMoveClient implementation:
+// DesktopWindowTreeHostLinux, aura::client::WindowMoveClient implementation:
aura::client::WindowMoveResult X11DesktopWindowMoveClient::RunMoveLoop(
aura::Window* source,
const gfx::Vector2d& drag_offset,
aura::client::WindowMoveSource move_source) {
window_offset_ = drag_offset;
- root_window_ = source->GetDispatcher();
+ host_ = source->GetHost();
- bool success = move_loop_.RunMoveLoop(source, root_window_->last_cursor());
+ bool success = move_loop_.RunMoveLoop(source, host_->last_cursor());
return success ? aura::client::MOVE_SUCCESSFUL : aura::client::MOVE_CANCELED;
}
void X11DesktopWindowMoveClient::EndMoveLoop() {
- window_move_timer_.Stop();
move_loop_.EndMoveLoop();
}
-////////////////////////////////////////////////////////////////////////////////
-// DesktopRootWindowHostLinux, private:
-
-void X11DesktopWindowMoveClient::SetHostBounds(const gfx::Rect& rect) {
- root_window_->SetHostBounds(rect);
-}
-
} // namespace views