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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 GrabModeAsync, | 254 GrabModeAsync, |
255 GrabModeAsync, | 255 GrabModeAsync, |
256 CurrentTime); | 256 CurrentTime); |
257 if (ret != GrabSuccess) { | 257 if (ret != GrabSuccess) { |
258 DLOG(ERROR) << "Grabbing keyboard for dragging failed: " | 258 DLOG(ERROR) << "Grabbing keyboard for dragging failed: " |
259 << ui::GetX11ErrorString(display, ret); | 259 << ui::GetX11ErrorString(display, ret); |
260 } | 260 } |
261 } | 261 } |
262 | 262 |
263 XUngrabServer(display); | 263 XUngrabServer(display); |
| 264 XFlush(display); |
264 return ret == GrabSuccess; | 265 return ret == GrabSuccess; |
265 } | 266 } |
266 | 267 |
267 Window X11WholeScreenMoveLoop::CreateDragInputWindow(XDisplay* display) { | 268 Window X11WholeScreenMoveLoop::CreateDragInputWindow(XDisplay* display) { |
268 // Creates an invisible, InputOnly toplevel window. This window will receive | 269 // Creates an invisible, InputOnly toplevel window. This window will receive |
269 // all mouse movement for drags. It turns out that normal windows doing a | 270 // all mouse movement for drags. It turns out that normal windows doing a |
270 // grab doesn't redirect pointer motion events if the pointer isn't over the | 271 // grab doesn't redirect pointer motion events if the pointer isn't over the |
271 // grabbing window. But InputOnly windows are able to grab everything. This | 272 // grabbing window. But InputOnly windows are able to grab everything. This |
272 // is what GTK+ does, and I found a patch to KDE that did something similar. | 273 // is what GTK+ does, and I found a patch to KDE that did something similar. |
273 unsigned long attribute_mask = CWEventMask | CWOverrideRedirect; | 274 unsigned long attribute_mask = CWEventMask | CWOverrideRedirect; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 for (int x = 0; x < in_bitmap->width(); ++x) { | 333 for (int x = 0; x < in_bitmap->width(); ++x) { |
333 if (SkColorGetA(in_row[x]) > kMinAlpha) | 334 if (SkColorGetA(in_row[x]) > kMinAlpha) |
334 return true; | 335 return true; |
335 } | 336 } |
336 } | 337 } |
337 | 338 |
338 return false; | 339 return false; |
339 } | 340 } |
340 | 341 |
341 } // namespace views | 342 } // namespace views |
OLD | NEW |