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 // This file defines utility functions for X11 (Linux only). This code has been | 5 // This file defines utility functions for X11 (Linux only). This code has been |
6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support | 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support |
7 // remains woefully incomplete. | 7 // remains woefully incomplete. |
8 | 8 |
9 #include "ui/base/x/x11_util.h" | 9 #include "ui/base/x/x11_util.h" |
10 | 10 |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
277 std::map< ::Cursor, XCustomCursor*> cache_; | 277 std::map< ::Cursor, XCustomCursor*> cache_; |
278 DISALLOW_COPY_AND_ASSIGN(XCustomCursorCache); | 278 DISALLOW_COPY_AND_ASSIGN(XCustomCursorCache); |
279 }; | 279 }; |
280 | 280 |
281 } // namespace | 281 } // namespace |
282 | 282 |
283 bool IsXInput2Available() { | 283 bool IsXInput2Available() { |
284 return DeviceDataManagerX11::GetInstance()->IsXInput2Available(); | 284 return DeviceDataManagerX11::GetInstance()->IsXInput2Available(); |
285 } | 285 } |
286 | 286 |
287 int GrabPointer(XID window, bool owner_events, ::Cursor cursor) { | |
pkotwicz
2014/12/22 23:44:16
The semantics of DesktopWindowTreeHostX11::SetCapt
sadrul
2014/12/23 16:53:50
How does this transfer happen? Can it be done by t
pkotwicz
2014/12/23 18:22:22
The transfer occurs internally in X. The transfer
sadrul
2015/01/14 20:34:01
Where in the chrome code do we attempt to transfer
pkotwicz
2015/01/14 20:50:07
We transfer capture from one WTH to another when d
| |
288 int event_mask = PointerMotionMask | ButtonReleaseMask | ButtonPressMask; | |
289 return XGrabPointer(gfx::GetXDisplay(), window, owner_events, event_mask, | |
290 GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime); | |
291 } | |
292 | |
293 void UngrabPointer() { | |
294 XUngrabPointer(gfx::GetXDisplay(), CurrentTime); | |
295 } | |
296 | |
287 static SharedMemorySupport DoQuerySharedMemorySupport(XDisplay* dpy) { | 297 static SharedMemorySupport DoQuerySharedMemorySupport(XDisplay* dpy) { |
288 int dummy; | 298 int dummy; |
289 Bool pixmaps_supported; | 299 Bool pixmaps_supported; |
290 // Query the server's support for XSHM. | 300 // Query the server's support for XSHM. |
291 if (!XShmQueryVersion(dpy, &dummy, &dummy, &pixmaps_supported)) | 301 if (!XShmQueryVersion(dpy, &dummy, &dummy, &pixmaps_supported)) |
292 return SHARED_MEMORY_NONE; | 302 return SHARED_MEMORY_NONE; |
293 | 303 |
294 #if defined(OS_FREEBSD) | 304 #if defined(OS_FREEBSD) |
295 // On FreeBSD we can't access the shared memory after it was marked for | 305 // On FreeBSD we can't access the shared memory after it was marked for |
296 // deletion, unless this behaviour is explicitly enabled by the user. | 306 // deletion, unless this behaviour is explicitly enabled by the user. |
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1495 << "request_code " << static_cast<int>(error_event.request_code) << ", " | 1505 << "request_code " << static_cast<int>(error_event.request_code) << ", " |
1496 << "minor_code " << static_cast<int>(error_event.minor_code) | 1506 << "minor_code " << static_cast<int>(error_event.minor_code) |
1497 << " (" << request_str << ")"; | 1507 << " (" << request_str << ")"; |
1498 } | 1508 } |
1499 | 1509 |
1500 // ---------------------------------------------------------------------------- | 1510 // ---------------------------------------------------------------------------- |
1501 // End of x11_util_internal.h | 1511 // End of x11_util_internal.h |
1502 | 1512 |
1503 | 1513 |
1504 } // namespace ui | 1514 } // namespace ui |
OLD | NEW |