OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/widget/desktop_aura/x11_desktop_window_move_client.h" | 5 #include "ui/views/widget/desktop_aura/x11_desktop_window_move_client.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 8 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
9 #undef RootWindow | 9 #undef RootWindow |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 : move_loop_(this), | 45 : move_loop_(this), |
46 root_window_(NULL) { | 46 root_window_(NULL) { |
47 } | 47 } |
48 | 48 |
49 X11DesktopWindowMoveClient::~X11DesktopWindowMoveClient() {} | 49 X11DesktopWindowMoveClient::~X11DesktopWindowMoveClient() {} |
50 | 50 |
51 void X11DesktopWindowMoveClient::OnMouseMovement(XMotionEvent* event) { | 51 void X11DesktopWindowMoveClient::OnMouseMovement(XMotionEvent* event) { |
52 gfx::Point cursor_point(event->x_root, event->y_root); | 52 gfx::Point cursor_point(event->x_root, event->y_root); |
53 gfx::Point system_loc = cursor_point - window_offset_; | 53 gfx::Point system_loc = cursor_point - window_offset_; |
54 | 54 |
55 gfx::Rect target_rect(system_loc, root_window_->GetHostSize()); | 55 gfx::Rect target_rect(system_loc, root_window_->host()->GetBounds().size()); |
56 | 56 |
57 window_move_timer_.Start( | 57 window_move_timer_.Start( |
58 FROM_HERE, | 58 FROM_HERE, |
59 base::TimeDelta::FromMilliseconds(kMoveDelay), | 59 base::TimeDelta::FromMilliseconds(kMoveDelay), |
60 base::Bind(&X11DesktopWindowMoveClient::SetHostBounds, | 60 base::Bind(&X11DesktopWindowMoveClient::SetHostBounds, |
61 base::Unretained(this), | 61 base::Unretained(this), |
62 target_rect)); | 62 target_rect)); |
63 } | 63 } |
64 | 64 |
65 void X11DesktopWindowMoveClient::OnMouseReleased() { | 65 void X11DesktopWindowMoveClient::OnMouseReleased() { |
(...skipping 24 matching lines...) Expand all Loading... |
90 } | 90 } |
91 | 91 |
92 //////////////////////////////////////////////////////////////////////////////// | 92 //////////////////////////////////////////////////////////////////////////////// |
93 // DesktopRootWindowHostLinux, private: | 93 // DesktopRootWindowHostLinux, private: |
94 | 94 |
95 void X11DesktopWindowMoveClient::SetHostBounds(const gfx::Rect& rect) { | 95 void X11DesktopWindowMoveClient::SetHostBounds(const gfx::Rect& rect) { |
96 root_window_->SetHostBounds(rect); | 96 root_window_->SetHostBounds(rect); |
97 } | 97 } |
98 | 98 |
99 } // namespace views | 99 } // namespace views |
OLD | NEW |