| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 "window_manager/real_x_connection.h" | 5 #include "window_manager/real_x_connection.h" |
| 6 | 6 |
| 7 extern "C" { | 7 extern "C" { |
| 8 #include <xcb/composite.h> | 8 #include <xcb/composite.h> |
| 9 #include <xcb/damage.h> | 9 #include <xcb/damage.h> |
| 10 #include <xcb/randr.h> | 10 #include <xcb/randr.h> |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 scoped_ptr_malloc<xcb_grab_pointer_reply_t> reply( | 308 scoped_ptr_malloc<xcb_grab_pointer_reply_t> reply( |
| 309 xcb_grab_pointer_reply(xcb_conn_, cookie, &error)); | 309 xcb_grab_pointer_reply(xcb_conn_, cookie, &error)); |
| 310 scoped_ptr_malloc<xcb_generic_error_t> scoped_error(error); | 310 scoped_ptr_malloc<xcb_generic_error_t> scoped_error(error); |
| 311 if (error) { | 311 if (error) { |
| 312 LOG(WARNING) << "Pointer grab for window " << XidStr(xid) << " failed"; | 312 LOG(WARNING) << "Pointer grab for window " << XidStr(xid) << " failed"; |
| 313 return false; | 313 return false; |
| 314 } | 314 } |
| 315 | 315 |
| 316 if (reply->status != XCB_GRAB_STATUS_SUCCESS) { | 316 if (reply->status != XCB_GRAB_STATUS_SUCCESS) { |
| 317 LOG(WARNING) << "Pointer grab for window " << XidStr(xid) | 317 LOG(WARNING) << "Pointer grab for window " << XidStr(xid) |
| 318 << " returned status " << reply->status; | 318 << " returned status " << static_cast<int>(reply->status); |
| 319 return false; | 319 return false; |
| 320 } | 320 } |
| 321 return true; | 321 return true; |
| 322 } | 322 } |
| 323 | 323 |
| 324 bool RealXConnection::UngrabPointer(bool replay_events, XTime timestamp) { | 324 bool RealXConnection::UngrabPointer(bool replay_events, XTime timestamp) { |
| 325 if (replay_events) | 325 if (replay_events) |
| 326 xcb_allow_events(xcb_conn_, XCB_ALLOW_REPLAY_POINTER, timestamp); | 326 xcb_allow_events(xcb_conn_, XCB_ALLOW_REPLAY_POINTER, timestamp); |
| 327 else | 327 else |
| 328 xcb_ungrab_pointer(xcb_conn_, timestamp); | 328 xcb_ungrab_pointer(xcb_conn_, timestamp); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 341 scoped_ptr_malloc<xcb_grab_keyboard_reply_t> reply( | 341 scoped_ptr_malloc<xcb_grab_keyboard_reply_t> reply( |
| 342 xcb_grab_keyboard_reply(xcb_conn_, cookie, &error)); | 342 xcb_grab_keyboard_reply(xcb_conn_, cookie, &error)); |
| 343 scoped_ptr_malloc<xcb_generic_error_t> scoped_error(error); | 343 scoped_ptr_malloc<xcb_generic_error_t> scoped_error(error); |
| 344 if (error) { | 344 if (error) { |
| 345 LOG(WARNING) << "Keyboard grab for window " << XidStr(xid) << " failed"; | 345 LOG(WARNING) << "Keyboard grab for window " << XidStr(xid) << " failed"; |
| 346 return false; | 346 return false; |
| 347 } | 347 } |
| 348 | 348 |
| 349 if (reply->status != XCB_GRAB_STATUS_SUCCESS) { | 349 if (reply->status != XCB_GRAB_STATUS_SUCCESS) { |
| 350 LOG(WARNING) << "Keyboard grab for window " << XidStr(xid) | 350 LOG(WARNING) << "Keyboard grab for window " << XidStr(xid) |
| 351 << " returned status " << reply->status; | 351 << " returned status " << static_cast<int>(reply->status); |
| 352 return false; | 352 return false; |
| 353 } | 353 } |
| 354 return true; | 354 return true; |
| 355 } | 355 } |
| 356 | 356 |
| 357 bool RealXConnection::RemoveInputRegionFromWindow(XWindow xid) { | 357 bool RealXConnection::RemoveInputRegionFromWindow(XWindow xid) { |
| 358 xcb_shape_rectangles(xcb_conn_, | 358 xcb_shape_rectangles(xcb_conn_, |
| 359 XCB_SHAPE_SO_SET, | 359 XCB_SHAPE_SO_SET, |
| 360 XCB_SHAPE_SK_INPUT, | 360 XCB_SHAPE_SK_INPUT, |
| 361 0, // ordering | 361 0, // ordering |
| (...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1475 string message; | 1475 string message; |
| 1476 StringAppendV(&message, format, ap); | 1476 StringAppendV(&message, format, ap); |
| 1477 va_end(ap); | 1477 va_end(ap); |
| 1478 | 1478 |
| 1479 LOG(WARNING) << "Got XCB error while " << message << ": " | 1479 LOG(WARNING) << "Got XCB error while " << message << ": " |
| 1480 << GetErrorText(error->error_code); | 1480 << GetErrorText(error->error_code); |
| 1481 return false; | 1481 return false; |
| 1482 } | 1482 } |
| 1483 | 1483 |
| 1484 } // namespace window_manager | 1484 } // namespace window_manager |
| OLD | NEW |