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_whole_screen_move_loop.h" | 5 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // must manually make aura think that the mouse button is pressed so that we | 115 // must manually make aura think that the mouse button is pressed so that we |
116 // don't draw extraneous tooltips. | 116 // don't draw extraneous tooltips. |
117 aura::Env* env = aura::Env::GetInstance(); | 117 aura::Env* env = aura::Env::GetInstance(); |
118 if (!env->IsMouseButtonDown()) { | 118 if (!env->IsMouseButtonDown()) { |
119 env->set_mouse_button_flags(ui::EF_LEFT_MOUSE_BUTTON); | 119 env->set_mouse_button_flags(ui::EF_LEFT_MOUSE_BUTTON); |
120 should_reset_mouse_flags_ = true; | 120 should_reset_mouse_flags_ = true; |
121 } | 121 } |
122 | 122 |
123 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); | 123 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); |
124 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop); | 124 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop); |
125 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); | 125 base::RunLoop run_loop; |
126 quit_closure_ = run_loop.QuitClosure(); | 126 quit_closure_ = run_loop.QuitClosure(); |
127 run_loop.Run(); | 127 run_loop.Run(); |
128 return true; | 128 return true; |
129 } | 129 } |
130 | 130 |
131 void X11WholeScreenMoveLoop::UpdateCursor(gfx::NativeCursor cursor) { | 131 void X11WholeScreenMoveLoop::UpdateCursor(gfx::NativeCursor cursor) { |
132 DCHECK(in_move_loop_); | 132 DCHECK(in_move_loop_); |
133 GrabPointerWithCursor(cursor); | 133 GrabPointerWithCursor(cursor); |
134 } | 134 } |
135 | 135 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 image->SetBounds(0, 0, drag_image_.width(), drag_image_.height()); | 236 image->SetBounds(0, 0, drag_image_.width(), drag_image_.height()); |
237 widget->SetContentsView(image); | 237 widget->SetContentsView(image); |
238 | 238 |
239 widget->Show(); | 239 widget->Show(); |
240 widget->GetNativeWindow()->layer()->SetFillsBoundsOpaquely(false); | 240 widget->GetNativeWindow()->layer()->SetFillsBoundsOpaquely(false); |
241 | 241 |
242 drag_widget_.reset(widget); | 242 drag_widget_.reset(widget); |
243 } | 243 } |
244 | 244 |
245 } // namespace views | 245 } // namespace views |
OLD | NEW |