| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <X11/keysym.h> | 8 #include <X11/keysym.h> |
| 9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 CHECK(capture_client->GetGlobalCaptureWindow() == NULL); | 152 CHECK(capture_client->GetGlobalCaptureWindow() == NULL); |
| 153 grabbed_pointer_ = GrabPointer(cursor); | 153 grabbed_pointer_ = GrabPointer(cursor); |
| 154 if (!grabbed_pointer_) { | 154 if (!grabbed_pointer_) { |
| 155 XDestroyWindow(gfx::GetXDisplay(), grab_input_window_); | 155 XDestroyWindow(gfx::GetXDisplay(), grab_input_window_); |
| 156 return false; | 156 return false; |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 | 159 |
| 160 GrabEscKey(); | 160 GrabEscKey(); |
| 161 | 161 |
| 162 scoped_ptr<ui::ScopedEventDispatcher> old_dispatcher = | 162 std::unique_ptr<ui::ScopedEventDispatcher> old_dispatcher = |
| 163 std::move(nested_dispatcher_); | 163 std::move(nested_dispatcher_); |
| 164 nested_dispatcher_ = | 164 nested_dispatcher_ = |
| 165 ui::PlatformEventSource::GetInstance()->OverrideDispatcher(this); | 165 ui::PlatformEventSource::GetInstance()->OverrideDispatcher(this); |
| 166 | 166 |
| 167 // We are handling a mouse drag outside of the aura::Window system. We must | 167 // We are handling a mouse drag outside of the aura::Window system. We must |
| 168 // manually make aura think that the mouse button is pressed so that we don't | 168 // manually make aura think that the mouse button is pressed so that we don't |
| 169 // draw extraneous tooltips. | 169 // draw extraneous tooltips. |
| 170 aura::Env* env = aura::Env::GetInstance(); | 170 aura::Env* env = aura::Env::GetInstance(); |
| 171 if (!env->IsMouseButtonDown()) { | 171 if (!env->IsMouseButtonDown()) { |
| 172 env->set_mouse_button_flags(ui::EF_LEFT_MOUSE_BUTTON); | 172 env->set_mouse_button_flags(ui::EF_LEFT_MOUSE_BUTTON); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 DefaultRootWindow(display), | 270 DefaultRootWindow(display), |
| 271 -100, -100, 10, 10, | 271 -100, -100, 10, 10, |
| 272 0, CopyFromParent, InputOnly, CopyFromParent, | 272 0, CopyFromParent, InputOnly, CopyFromParent, |
| 273 attribute_mask, &swa); | 273 attribute_mask, &swa); |
| 274 XMapRaised(display, window); | 274 XMapRaised(display, window); |
| 275 ui::X11EventSource::GetInstance()->BlockUntilWindowMapped(window); | 275 ui::X11EventSource::GetInstance()->BlockUntilWindowMapped(window); |
| 276 return window; | 276 return window; |
| 277 } | 277 } |
| 278 | 278 |
| 279 } // namespace views | 279 } // namespace views |
| OLD | NEW |